keen/hash

Source
This is a standard module and does not need to be explicitly imported.

Functions for getting hash codes.

Hash codes are used internally by map and set types, which require a hash implementation for the key type.

hash-state record mut (has private fields)
hash[t] spec
hash void(a t, state hash-state)

Spec that should be implemented for any type used as a map key.

hash on a composite type (such as a record or collection) usually just calls hash for each value it contains.

hash on a union should mix a number or name for the union member, then mix its associated value, if any.

new hash-state()
new hash-state(seed nat64)
finish nat64(a hash-state)
sorted-key[k] spec k data, k equal, k compare
Spec for types that can be used as keys in sorted collections that don't need hashing.
key[k] spec k sorted-key, k hash
Spec for types that can be used as keys in any map or set.
seeded-hash[t] nat64(a t) global, t hash
Get a hash code based on a global random seed. This will return the same value given the same argument in the same process, but will be different for each new process.
deterministic-hash[t] nat64(a t) t hash
Get a deterministic hash code for any value.
deterministic-hash[t] nat64(a t, seed nat64) t hash