What is the best algorithm for an overridden System.Object.GetHashCode?

Posted by bitbonk on Stack Overflow See other posts from Stack Overflow or by bitbonk
Published on 2008-11-04T20:53:19Z Indexed on 2010/03/23 7:13 UTC
Read the original article Hit count: 313

Filed under:
|
|
|

In .NET System.Object.GetHashCode method is use in a lot of places throughout the .NET base class libraries. Especially when finding items in a collection fast or to determine equality. Is there a standard algorithm/ best practise on how to implement the GetHashCode override for my custom classes so I don't degrate performance?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about beginner