I have a structure in C#:
public struct UserInfo { public string str1 { get; set; } public string str2 { get; set; }
Ah yes, as Gary Shutler pointed out:
return str1.GetHashCode() + str2.GetHashCode();
Can overflow. You could try casting to long as Artem suggested, or you could surround the statement in the unchecked keyword:
return unchecked(str1.GetHashCode() + str2.GetHashCode());