Interface IDeepSecureEqualityComparer<T>
- Namespace
- Nerdbank.MessagePack
- Assembly
- Nerdbank.MessagePack.dll
An interface that may be implemented by user-defined types in order to provide their own deep (i.e. giving all values a chance to contribute) hash code.
public interface IDeepSecureEqualityComparer<T>
Type Parameters
T
The same type that is implementing this interface.
Remarks
When a type implements this interface, GetHashCode() and DeepEquals(T?) is used to determine equality and hash codes for the type by the ByValueEqualityComparer<T, TProvider> equality comparer instead of the deep by-value automatic implementation.
Methods
DeepEquals(T?)
Tests deep equality of this object with another object.
bool DeepEquals(T? other)
Parameters
other
TThe other object.
Returns
Remarks
An implementation may use Default to obtain equality comparers for any sub-values that must be tested.
GetHashCode()
Gets a hash code for this object, which may not be collision resistant.
int GetHashCode()
Returns
- int
A 32-bit integer.
Remarks
The default implementation of this method is to truncate the result of GetSecureHashCode().
GetSecureHashCode()
Gets a collision resistant hash code for this object.
long GetSecureHashCode()
Returns
- long
A 64-bit integer.
Exceptions
- NotSupportedException
May be thrown if not supported.