Possible Duplicate:
Create a hashcode of two numbers
I have following class:
public struct Test
{
public string Prop1 { get; set; }
public string Prop2 { get; set; }
public override int GetHashCode()
{
return Prop1.GetHashCode() ^ Prop2.GetHashCode();
}
}
Today I found out that I'm computing GetHashCode in a wrong way - if both properties are the same it always returns 0. How to do it the right way?