title: Getting hash of a list of strings regardless of order
body: <p>I would like to write a function <code>GetHashCodeOfList()</code> which returns a hash-code of a list of strings regardless of order. Given 2 lists with the same strings should return the same hash-code. </p>
  
  <pre><code>ArrayList list1 = new ArrayList()    
  list1.Add("String1");
  list1.Add("String2");
  list1.Add("String3");    
  
  ArrayList list2 = new ArrayList()    
  list2.Add("String3");    
  list2.Add("String2"); 
  list2.Add("String1");
  
  GetHashCodeOfList(list1) = GetHashCodeOfList(list2) //this should be equal.
  </code></pre>
  
  <p>I had a few thoughts: </p>
  
  <ol>
  <li><p>I can first sort the list, then combine the sorted list into 1 long string and then call <code>GetHashCode()</code>. However sorting is a slow operation.</p></li>
  <li><p>I can get the hash of each individual string (by calling <code>string.GetHashCode()</code>) in the list, then multiplying all hashes and calling Mod <code>UInt32.MaxValue</code>. 
  For example: <code>"String1".GetHashCode() * "String2".GetHashCode * … MOD UInt32.MaxValue</code>. But this results in a number overflow.</p></li>
  </ol>
  
  <p>Does anyone have any thoughts?</p>
  
  <p>Thanks in advance for your help.</p>