RollingHash64

Trait RollingHash64 

Source
pub trait RollingHash64 {
    // Required methods
    fn reset(&mut self);
    fn prefill_window<I>(&mut self, iter: &mut I) -> usize
       where I: Iterator<Item = u8>;
    fn reset_and_prefill_window<I>(&mut self, iter: &mut I) -> usize
       where I: Iterator<Item = u8>;
    fn slide(&mut self, byte: u8);
    fn get_hash(&self) -> &Polynom64;
}
Expand description

A rolling hash implementation for 64 bit polynoms.

Required Methods§

Source

fn reset(&mut self)

Resets the rolling hash.

Source

fn prefill_window<I>(&mut self, iter: &mut I) -> usize
where I: Iterator<Item = u8>,

Attempt to prefill the window

§Arguments
  • iter - The iterator to read from.
Source

fn reset_and_prefill_window<I>(&mut self, iter: &mut I) -> usize
where I: Iterator<Item = u8>,

Combines a reset with a prefill in an optimized way.

§Arguments
  • iter - The iterator to read from.
Source

fn slide(&mut self, byte: u8)

Slides the window by byte.

§Arguments
  • byte - The byte to slide in.
Source

fn get_hash(&self) -> &Polynom64

Returns the current hash as a Polynom64.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§