Key.toHash

size_t toHash() const;

Computes a hash of the key material for use as an associative array key.

Implementations should hash the algorithm name and encoded key bytes.

Note

When implementing this method, ensure that toHash and opEquals

are consistent: if opEquals(a, b) returns true, then toHash(a) must equal toHash(b). Violating this contract will cause undefined behavior when using keys in associative arrays, including potential AA corruption and lost entries.

Returns

A hash value suitable for associative array indexing.