pub struct PartialFNVHash(/* private fields */);Expand description
Hasher which computes the lowest 6 bits of a 32-bit FNV-1 variant.
This variant of FNV-1 hash has the regular prime constant of 0x01000193
but has a different initial state: 0x28021967 (in contrast to regular
FNV-1-32’s 0x811c9dc5).
Since ssdeep only uses the lowest 6 bits of the hash value, it ignores any higher bits, enabling updating the state table-based (instead of multiply and xor).
Implementations§
Source§impl PartialFNVHash
impl PartialFNVHash
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new PartialFNVHash with the initial value.
Sourcepub fn update_by_byte(&mut self, ch: u8) -> &mut Self
pub fn update_by_byte(&mut self, ch: u8) -> &mut Self
Updates the hash value by processing a byte.
Sourcepub fn update_by_iter(&mut self, iter: impl Iterator<Item = u8>) -> &mut Self
pub fn update_by_iter(&mut self, iter: impl Iterator<Item = u8>) -> &mut Self
Updates the hash value by processing an iterator of u8.
Trait Implementations§
Source§impl AddAssign<&[u8]> for PartialFNVHash
impl AddAssign<&[u8]> for PartialFNVHash
Source§fn add_assign(&mut self, buffer: &[u8])
fn add_assign(&mut self, buffer: &[u8])
Updates the hash value by processing a slice of u8.
Source§impl AddAssign<u8> for PartialFNVHash
impl AddAssign<u8> for PartialFNVHash
Source§fn add_assign(&mut self, byte: u8)
fn add_assign(&mut self, byte: u8)
Updates the hash value by processing a byte.
Source§impl Clone for PartialFNVHash
impl Clone for PartialFNVHash
Source§fn clone(&self) -> PartialFNVHash
fn clone(&self) -> PartialFNVHash
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 PartialFNVHash
impl Debug for PartialFNVHash
Source§impl Default for PartialFNVHash
impl Default for PartialFNVHash
Source§impl PartialEq for PartialFNVHash
impl PartialEq for PartialFNVHash
impl Copy for PartialFNVHash
impl Eq for PartialFNVHash
impl StructuralPartialEq for PartialFNVHash
Auto Trait Implementations§
impl Freeze for PartialFNVHash
impl RefUnwindSafe for PartialFNVHash
impl Send for PartialFNVHash
impl Sync for PartialFNVHash
impl Unpin for PartialFNVHash
impl UnwindSafe for PartialFNVHash
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