Hash

Hash implements hash : hasher, a -> hasher where a implements Hash, hasher implements Hasher

A value that can be hashed.

Hasher implements addBytes : a, List U8 -> a where a implements Hasher addU8 : a, U8 -> a where a implements Hasher addU16 : a, U16 -> a where a implements Hasher addU32 : a, U32 -> a where a implements Hasher addU64 : a, U64 -> a where a implements Hasher addU128 : a, U128 -> a where a implements Hasher complete : a -> U64 where a implements Hasher

Describes a hashing algorithm that is fed bytes and produces an integer hash.

The Hasher ability describes general-purpose hashers. It only allows emission of 64-bit unsigned integer hashes. It is not suitable for cryptographically-secure hashing.

hashStrBytes

Adds a string into a Hasher by hashing its UTF-8 bytes.

hashList

Adds a list of Hashable elements to a Hasher by hashing each element.

hashBool : a, Bool -> a where a implements Hasher

Adds a single Bool to a hasher.

hashI8 : a, I8 -> a where a implements Hasher

Adds a single I8 to a hasher.

hashI16 : a, I16 -> a where a implements Hasher

Adds a single I16 to a hasher.

hashI32 : a, I32 -> a where a implements Hasher

Adds a single I32 to a hasher.

hashI64 : a, I64 -> a where a implements Hasher

Adds a single I64 to a hasher.

hashI128 : a, I128 -> a where a implements Hasher

Adds a single I128 to a hasher.

hashDec : a, Dec -> a where a implements Hasher

Adds a single Dec to a hasher.

hashUnordered

Adds a container of Hashable elements to a Hasher by hashing each element. The container is iterated using the walk method passed in. The order of the elements does not affect the final hash.