O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

IHashCodeProvider

Synopsis

This interface implements a custom hash function to supply a hashcode to an object. Normally hashtables use System.Object.GetHashCode() for hash keys. However, if a Hashtable is constructed using an object that implements this interface, GetHashCode() can be used to provide a customized hash function. CaseInsensitiveHashCodeProvider is an example of a custom hash function.

public interface IHashCodeProvider {
// Public Instance Methods
   public method int GetHashCode(object obj);  
}

Implemented By

CaseInsensitiveHashCodeProvider

Returned By

Hashtable.hcp

Passed To

Hashtable.{Hashtable(), hcp}, System.Collections.Specialized.NameObjectCollectionBase.NameObjectCollectionBase(), System.Collections.Specialized.NameValueCollection.NameValueCollection()

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required