Skip to main content

compute_hash

Function compute_hash 

Source
pub fn compute_hash(bytes: &[u8], base: u64, mod_: u64) -> u64
Expand description

Compute the polynomial hash of a byte slice.

h(s) = s[0]*b^(n-1) + s[1]*b^(n-2) + ... + s[n-1] (mod mod_).