Class MultiplyShiftHash

Class Documentation

class MultiplyShiftHash

h( k ) = ( a k mod 2^h ) div 2^( h - l ), with a odd

Public Functions

MultiplyShiftHash(int h, int l, std::uint64_t seed = 1)

a function with a random odd a, from the seed

Pre:

1 <= l < h <= 64

std::uint64_t operator()(std::uint64_t k) const
Pre:

k < 2^h

Post:

the result is below 2^l

Public Static Functions

static MultiplyShiftHash ofMultiplier(int h, int l, std::uint64_t a)

the function of the multiplier a

Pre:

1 <= l < h <= 64, a odd and below 2^h