yammh3 package

Module contents

yammh3.get_include()[source]

Returns the includes directory.

Returns:out – Directory that contains header files.
Return type:str
yammh3.hash128(value, seed=0, signed=True, x64=False)[source]

Returns a 128 bits hash for the given value.

Parameters:
  • value (unicode or str) – Value to be hashed.
  • seed (int, optional) – Seed for the hash algorithm. Default is 0.
  • signed (bool, optional) – If True, returns a signed integer, otherwise returns an unsigned integer. Default is True.
  • x64 (bool, optional) – Whether to use x64 optimized hash functions. Default is False.
Returns:

out – A tuple of 64 bits integers (high, low).

Return type:

tuple

yammh3.hash64(value, seed=0, signed=True, low=False, x64=False)[source]

Returns a 64 bits hash for the given value.

This function uses the 128 bits hash function internally and the low parameter controls which part of bits are returned.

Parameters:
  • value (unicode or str) – Value to be hashed.
  • seed (int, optional) – Seed for the hash algorithm. Default is 0.
  • signed (bool, optional) – If True, returns a signed integer, otherwise returns an unsigned integer. Default is True.
  • low (bool, optional) – Whether to returns low bits rather than high bits. Default is False.
  • x64 (bool, optional) – Whether to use x64 optimized hash functions. Default is False.
Returns:

out – A 64 bits integer.

Return type:

int

yammh3.hash32(value, seed=0, signed=True)[source]

Returns a 32 bits hash for the given value.

Parameters:
  • value (unicode or str) – Value to be hashed.
  • seed (int, optional) – Seed for the hash algorithm. Default is 0.
  • signed (bool, optional) – If True, returns a signed integer, otherwise returns an unsigned integer. Default is True.
Returns:

out – A 32 bits integer.

Return type:

int