IHashCodeProvider Interface
Supplies a hash code for an object, using a custom hash function.
For a list of all members of this type, see IHashCodeProvider Members.
[Visual Basic] Public Interface IHashCodeProvider [C#] public interface IHashCodeProvider [C++] public __gc __interface IHashCodeProvider [JScript] public interface IHashCodeProvider
Classes that Implement IHashCodeProvider
| Class | Description |
|---|---|
| CaseInsensitiveHashCodeProvider | Supplies a hash code for an object, using a hashing algorithm that ignores the case of strings. |
Remarks
The IHashCodeProvider interface is used in conjunction with Hashtable. The objects used as keys by a Hashtable must implement or inherit the Object.GetHashCode and Object.Equals methods. Object.GetHashCode or the key's implementation of Object.GetHashCode is used as the hash code provider. Object.Equals or the key's implementation of Object.Equals is used as the comparer.
However, some overloads of the Hashtable constructor take a parameter that is an IHashCodeProvider implementation, or a parameter that is an IComparer implementation, or both. If an IHashCodeProvider implementation is passed to the constructor, the IHashCodeProvider.GetHashCode of that implementation is used as the hash code provider. If an IComparer implementation is passed to the constructor, the IComparer.Compare of that implementation is used as the comparer.
Requirements
Namespace: System.Collections
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework
Assembly: Mscorlib (in Mscorlib.dll)
See Also
IHashCodeProvider Members | System.Collections Namespace | Hashtable | IHashCodeProvider | IComparer | CaseInsensitiveHashCodeProvider