pub struct RollingHash { /* private fields */ }Expand description
Single-modulus rolling hash with O(1) append / slide.
Implementations§
Source§impl RollingHash
impl RollingHash
Sourcepub fn with_base_mod(base: u64, mod_: u64) -> Self
pub fn with_base_mod(base: u64, mod_: u64) -> Self
Create with a custom base and modulus.
Sourcepub fn push(&mut self, byte: u8)
pub fn push(&mut self, byte: u8)
Append a byte to the hash, computing
h = (h * base + byte) mod mod_.
Trait Implementations§
Source§impl Clone for RollingHash
impl Clone for RollingHash
Source§fn clone(&self) -> RollingHash
fn clone(&self) -> RollingHash
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RollingHash
impl Debug for RollingHash
Auto Trait Implementations§
impl Freeze for RollingHash
impl RefUnwindSafe for RollingHash
impl Send for RollingHash
impl Sync for RollingHash
impl Unpin for RollingHash
impl UnsafeUnpin for RollingHash
impl UnwindSafe for RollingHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more