Template Function shad::HashFunction(const KeyTy&, uint8_t)

Function Documentation

template <typename KeyTy>
uint64_t shad::HashFunction(const KeyTy &key, uint8_t seed)

Jenkins one-at-a-time hash function.

The original algorithm was proposed by Bob Jenkins in 1997 in a Dr. Dobbs article. It is a non-cryptographic hash-function for multi-byte keys. Our implementation produces a 64-bit hashing two bytes at time.

Typical Usage:

ValueType value;
uint8_t ultimateSeed = 42;
auto hash = shad::HashFunction(value, ultimateSeed);

Return
A 8-bytes long hash value.
Template Parameters
  • KeyTy: The type of the key to hash.
Parameters
  • key: The key to be hashed.
  • seed: A random seed for the hashing process.