Skip to main content

map64_to_64

Function map64_to_64 

Source
pub fn map64_to_64(hash: u64, n: u64) -> u64
Expand description

Maps 64-bit hash to the range [0, n), where n is a 64-bit integer.

Uses the algorithm described in: Daniel Lemire, A fast alternative to the modulo reduction, https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/