Hash

Hash values

Hash

type Hash = Word32

Hash values represent a string of hash bits, packed into a Word32.

length

let length : Nat

The hash length, always 31.

bit

func bit(h : Hash, pos : Nat) : Bool

Project a given bit from the bit vector.

equal

func equal(ha : Hash, hb : Hash) : Bool

Test if two hashes are equal

hash

func hash(i : Nat) : Hash

debugPrintBits

func debugPrintBits(bits : Hash)

debugPrintBitsRev

func debugPrintBitsRev(bits : Hash)

hashWord8

func hashWord8(key : [Hash]) : Hash

Jenkin’s one at a time:

The input type should actually be [Word8]. Note: Be sure to explode each Word8 of a Word32 into its own Word32, and to shift into lower 8 bits.