pub struct BlindNtHash { /* private fields */ }Expand description
Rolling hash over a fixed‑width window that the caller rolls manually.
The window is stored in a VecDeque<u8>:
roll()removes the front base and pushes a new base at the back.roll_back()does the opposite.peek()/peek_back()compute hashes for the next / previous window without mutating internal state.
Implementations§
Source§impl BlindNtHash
impl BlindNtHash
Sourcepub fn new(seq: &[u8], k: u16, num_hashes: u8, pos: isize) -> Result<Self>
pub fn new(seq: &[u8], k: u16, num_hashes: u8, pos: isize) -> Result<Self>
Create a new BlindNtHash whose initial window is seq[pos..pos+k].
- The caller must guarantee* that the slice contains no ambiguous bases (‘N’) – the blind variant will not skip over invalid windows.
§Errors
Returns if k == 0, seq.len() < k, or pos too large.
pub fn roll_back(&mut self, char_in: u8) -> bool
pub fn peek_back(&mut self, char_in: u8)
pub fn hashes(&self) -> &[u64]
pub fn pos(&self) -> isize
pub fn forward_hash(&self) -> u64
pub fn reverse_hash(&self) -> u64
Auto Trait Implementations§
impl Freeze for BlindNtHash
impl RefUnwindSafe for BlindNtHash
impl Send for BlindNtHash
impl Sync for BlindNtHash
impl Unpin for BlindNtHash
impl UnwindSafe for BlindNtHash
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