title: Hash function on list independant of order of items in it
body: <p>I want to have a dictionary that assigns a value to a set of integers.</p>
  
  <p>For example <code>key</code> is <code>[1 2 3]</code> and <code>value</code> will have certain value.</p>
  
  <p>The thing is that <code>[3 2 1]</code> needs to be treated the same in my case so hash needs to be equal, if I go with hash approach.</p>
  
  <p>The set will have 2 to 10 items.</p>
  
  <p>Sum of items is usually fixed so we cannot make hashcode according to sum, which is a first natural idea here.</p>
  
  <p>Not a homework task, actually facing this problem in my code.</p>
  
  <p>This set is basically <code>IEnumerable&lt;int&gt;</code> in C# so any data structure is fine to store them.</p>
  
  <p>Any help appreciated. Performance is pretty important here too.</p>
  
  <p>An immediate thought: we could sum up <code>items^2</code> and already get some kind of better hash, but still I would like to hear some thoughts.</p>
  
  <p><strong>EDIT:</strong> hmm <em>really sorry guys</em>, everyone suggests ordering, didn't come to my mind that I needed to say that actually ordering and hashing is the current solution I use and I am considering faster alternatives.</p>