Mono Class Library: System.Collections.IHashCodeProvider Overview | MembersSystem.Collections.IHashCodeProvider.GetHashCode Method |
Generates a hash code for the specified object. [Edit]
|
A int containing the hash code for the specified object. [Edit]
Type Reason ArgumentNullException obj is null. [Edit]
Operation
If obj is null, it is required that a call to IHashCodeProvider.GetHashCode(object) throw ArgumentNullException.Note to Inheritors
Implement this method to generate a better hash table distribution than the default method provided by the type of the object for which the hash code is being generated.Usage
The value returned by this method should not be persisted past the lifetime of the application that created the value. The first reason is that the hash function of a class might be altered to generate a better distribution, rendering any values from the old hash function useless. The second reason is that the default implementation of this class does not guarantee that the same value will be returned by different instances. [Edit]
Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0