title: Consistent HashCode for a List of String accross processes/platforms
body: <p>I had a look at the following question:</p>
  
  <p><a href="https://stackoverflow.com/questions/8094867/good-gethashcode-override-for-list-of-foo-objects-respecting-the-order/">Good GetHashCode() override for List of Foo objects respecting the order</a></p>
  
  <p>And asked Jon Skeet the following:
  <a href="https://stackoverflow.com/questions/8094867/good-gethashcode-override-for-list-of-foo-objects-respecting-the-order/8094931#comment63208639_8094931">Good GetHashCode() override for List of Foo objects respecting the order</a></p>
  
  <p><em>"@JonSkeet  does that solution produce consistent result with List of string across multiple AppDomains? I have a WCF Server where multiple application from various platforms (XP, Vista, Win7 or different .Net Frameworks 3.5 and higher) can connect and in all those situations I need a consistent hashcode from a list of strings is that the case? If not how would I achieve that?"</em></p>
  
  <p>His answer:
  "@RandRandom: You shouldn't be using GetHashCode for that - it's not meant to be consistent across different processes. You should use something like SHA-256 for that. "</p>
  
  <p>Not sure how the implementation of his proposed answer would look like, so to not ask detailed question in the comments area I decided to create a new question.</p>
  
  <p>So assume you have the following list:</p>
  
  <pre><code>var fooList = new List&lt;string&gt;()
  {
      "",
      "StatAccount",
      "Value",
      "9900000701",
      "P1",
      "3",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "VFE-Lage.xlsx",
      "",
      "",
      "False",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
  };
  </code></pre>
  
  <p>Now I need a hashCode that's easier/faster to compare than checking for SequenceEquality, my list is immutable it never changes.</p>
  
  <p>I have a class looking something like this:</p>
  
  <pre><code>public class Foo
  {
      private List&lt;string&gt; _fooList = new List&lt;string&gt;();
      private int _fooListHashCode;
  
      public List&lt;string&gt; FooList
      {
          get
          {
              return _fooList;
          }
          set
          {
              _fooList = value;
              _fooListHashCode = GetListsHashCode(value);
          }
      }
  
      public static int GetListsHashCode(List&lt;string&gt; list)
      {
          //return hashCode...
          return 0;
      }
  
      public override int GetHashCode()
      {
          return _fooListHashCode;
      }
  
      public override bool Equals(object obj)
      {
          var foo = obj as Foo;
          if (foo == null)
              return false;
  
          return this._fooListHashCode == foo._fooListHashCode;
      }
  }
  </code></pre>