Function ADS::hash_midsquare

Function Documentation

std::uint64_t ADS::hash_midsquare(std::uint64_t i, int p)

the middle square: the p bits in the middle of the 64 least significant ones of i^2

Pre:

1 <= p <= 32

Post:

the result is below 2^p