System.Generics.Defaults.IEqualityComparer.GetHashCode
Delphi
function GetHashCode(const Value: T): Integer;
C++
virtual int __fastcall GetHashCode(const T Value) = 0 ;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Generics.Defaults.pas System.Generics.Defaults.hpp |
System.Generics.Defaults | IEqualityComparer |
Description
GetHashCode is a generic method used to generate the hash code for a value.
Use GetHashCode to generate the hash code for the given input value. Any class that implements the IEqualityComparer interface is expected to provide the implementation for the GetHashCode method.
Note: The generated hash codes are not required to be unique. Still, we recommend that the generated values be as different as possible from one another. Two equal values are required to have the same hash code, while two different values are not required to have different hash codes.