narrow_down.hash module#

General purpose hash functions.

class narrow_down.hash.HashAlgorithm(value)[source]#

Bases: Flag

Enum of available hash algorithms.

Murmur3_32bit = 1#
Xxhash_32bit = 2#
Xxhash_64bit = 4#
narrow_down.hash.murmur3_32bit(s: bytes) int#

Calculate the 32 bit murmur3 hash of the input string.

narrow_down.hash.xxhash_32bit(s: bytes) int#

Calculate the 32 bit xxhash of the input string.

narrow_down.hash.xxhash_64bit(s: bytes) int#

Calculate the 64 bit xxhash of the input string.