Hashtable.GetHash(Object) Hashtable.GetHash(Object) Hashtable.GetHash(Object) Hashtable.GetHash(Object) Method

Definition

Returns the hash code for the specified key.

protected:
 virtual int GetHash(System::Object ^ key);
protected virtual int GetHash (object key);
abstract member GetHash : obj -> int
override this.GetHash : obj -> int
Protected Overridable Function GetHash (key As Object) As Integer

Parameters

key
Object Object Object Object

The Object for which a hash code is to be returned.

Returns

The hash code for key.

Exceptions

Remarks

If the hash table was created with a specific IHashCodeProvider implementation, this method uses that hash code provider; otherwise, it uses the Object.GetHashCode implementation of key.

This method is an O(1) operation.

Applies to

See also