pub struct StableHasher { /* private fields */ }Expand description
FNV-1a, 64-bit, specified here rather than borrowed.
Fingerprints are written into .dry4rust-ignore.toml and are expected to
still match the next time the tool runs – possibly under a different
toolchain. DefaultHasher cannot promise that: the standard library says
its algorithm is unspecified and not to be relied upon across releases. A
suppression that silently stops matching is the worst kind of failure,
because the duplicate simply reappears with no explanation.
So the algorithm lives here, in eight lines anyone can check against the published FNV specification, and every integer is written big-endian at a fixed width so that a 32-bit machine and a 64-bit one agree.
Implementations§
Source§impl StableHasher
impl StableHasher
pub const fn new() -> Self
Sourcepub const fn write_bytes(&mut self, bytes: &[u8])
pub const fn write_bytes(&mut self, bytes: &[u8])
Absorb raw bytes.
Sourcepub const fn write_u64(&mut self, value: u64)
pub const fn write_u64(&mut self, value: u64)
Absorb an integer, big-endian and eight bytes wide regardless of the platform’s word size.