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) unless the opt-reduce-fnv-table feature is enabled.
§Compatibility Notice
This type is going to be completely private on the next major release. If you need to experiment with internal hashing functions, just vendor the source code for your needs.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more