Type Alias StableHasher
pub type StableHasher = StableHasher<SipHasher128>;
Expand description
Stable 128-bits Sip Hasher
StableHasher
version of [SipHasher128
].
Aliased Type§
struct StableHasher { /* private fields */ }
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 120 bytes
Implementations
§impl<H> StableHasher<H>where
H: ExtendedHasher,
impl<H> StableHasher<H>where
H: ExtendedHasher,
pub fn with_hasher(state: H) -> StableHasher<H>
pub fn with_hasher(state: H) -> StableHasher<H>
Creates a new [StableHasher
] from an already created [ExtendedHasher
].
Useful when wanting to initialize a hasher with different parameters/keys.
Important: Any use of the hasher before being given to a [StableHasher
]
is not covered by this crate guarentees and will make the resulting hash
NOT platform independent.
pub fn finish<W>(self) -> Wwhere
W: FromStableHash<Hash = <H as ExtendedHasher>::Hash>,
pub fn finish<W>(self) -> Wwhere
W: FromStableHash<Hash = <H as ExtendedHasher>::Hash>,
Returns the typed-hash value for the values written.
The resulting typed-hash value is constructed from an
[FromStableHash
] implemenation.
To be used in-place of Hasher::finish
.
Trait Implementations
§impl<H> Hasher for StableHasher<H>where
H: ExtendedHasher,
impl<H> Hasher for StableHasher<H>where
H: ExtendedHasher,
§fn finish(&self) -> u64
fn finish(&self) -> u64
Returns a combined hash.
For greater precision use instead [StableHasher::finish
].
§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
u128
into this hasher.§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
usize
into this hasher.§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
i128
into this hasher.§fn write_isize(&mut self, i: isize)
fn write_isize(&mut self, i: isize)
isize
into this hasher.Source§fn write_length_prefix(&mut self, len: usize)
fn write_length_prefix(&mut self, len: usize)
hasher_prefixfree_extras
)