crow/hash.crow (source)

Functions for getting hash codes.

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

hash-mix[t] spec

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

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

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

hash[t] nat64(a t) t hash-mix

Get a hash code for any value.

hasher record mut

(has non-public fields)

    Type that stores the state of hashing.

    hash-mix void(hasher hasher, a nat8)

    hash-mix void(hasher hasher, a nat16)

    hash-mix void(hasher hasher, a nat32)

    hash-mix void(hasher hasher, a nat64)

    hash-mix void(hasher hasher, a int8)

    hash-mix void(hasher hasher, a int16)

    hash-mix void(hasher hasher, a int32)

    hash-mix void(hasher hasher, a int64)

    hash-mix void(hasher hasher, a bool)