A class containing methods to help with hash codes.
public static class HashCodeHelper
Generates a hash code from the provided values. A hash code can be generated for any type of object, by passing its fields as arguments to this method.
public static int CalculateHashCode(params object inObjectArray)
An array of values from which to calculate a hash code.
A hash code generated from the provided values.
This method is a modification of a method documented on Stack Overflow by Jon Skeet, which in turn is derived from the FNV (Fowler/Noll/Vo) hash algorithm . This method differs in that it uses a randomly assigned number as the offset basis. Doing so means that a hash value for the same object will be different when calculated in a different process. This behaviour is a better match for default hash code behaviour as of .NET 5.0 (and optional behaviour that can be enabled in the .NET Framework by enabling the use of the randomised string hash algorithm ).