<p>I have a structure in C#:</p>

<pre><code>public struct UserInfo
{
   public string str1
   {
     get;
     set;
   }

   public string str2
   {
     get;
     set;
   }   
}
</code></pre>

<p>The only rule is that  <code>UserInfo(str1="AA", str2="BB").Equals(UserInfo(str1="BB", str2="AA"))</code></p>

<p>How to override the GetHashCode function for this structure? </p>

Many possibilities. E.g.
```
return str1.GetHashCode() ^ str1.GetHashCode()
```