Pike v8.0 release 1738

Method lfun::__hash()


Method __hash

int __hash()

Description

Hashing callback.

The main caller of this function is hash_value() or the low-level equivalent, which get called by various mapping operations when the object is used as index in a mapping.

Returns

It should return an integer that corresponds to the object in such a way that all values which lfun::`== considers equal to the object get the same hash value.

Note

The function hash does not return hash values that are compatible with this one.

Note

It's assumed that this function is side-effect free.

See also

lfun::`==, hash_value()