pub trait RollingHasher {
type Hash;
// Required methods
fn new(block_size: usize) -> Self;
fn reset(&mut self, block_size: usize);
fn update(&mut self, block: &[u8], block_size: usize);
fn rotate(&mut self, old: u8, new: u8, block_size: usize);
fn value(&self) -> Self::Hash;
}
Expand description
Used to make RollingHash
generic.
This is implemented by the Adler32
algorithm and both variants of the
cyclic poly 32 algorithm. The
implementation of cyclic poly 23 is in a Box
due to the large size of the struct
(1KiB and 2KiB for the 32- and 64-bit implementations respectively).