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
Source§impl<H> StableHasher<H>where
H: ExtendedHasher + Default,
impl<H> StableHasher<H>where
H: ExtendedHasher + Default,
Sourcepub fn new() -> StableHasher<H>
pub fn new() -> StableHasher<H>
Creates a new StableHasher
.
To be used with the Hasher
implementation and StableHasher::finish
.
Source§impl<H> StableHasher<H>where
H: ExtendedHasher,
impl<H> StableHasher<H>where
H: ExtendedHasher,
Sourcepub 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.
Sourcepub fn finish<W>(self) -> W
pub fn finish<W>(self) -> W
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
Source§impl<H> Debug for StableHasher<H>where
H: ExtendedHasher + Debug,
impl<H> Debug for StableHasher<H>where
H: ExtendedHasher + Debug,
Source§impl<H> Default for StableHasher<H>where
H: ExtendedHasher + Default,
impl<H> Default for StableHasher<H>where
H: ExtendedHasher + Default,
Source§fn default() -> StableHasher<H>
fn default() -> StableHasher<H>
Creates a new StableHasher
.
To be used with the Hasher
implementation and StableHasher::finish
.
Source§impl<H> Hasher for StableHasher<H>where
H: ExtendedHasher,
impl<H> Hasher for StableHasher<H>where
H: ExtendedHasher,
Source§fn finish(&self) -> u64
fn finish(&self) -> u64
Returns a combined hash.
For greater precision use instead StableHasher::finish
.
Source§fn write_str(&mut self, s: &str)
fn write_str(&mut self, s: &str)
hasher_prefixfree_extras
)str
into this hasher. Read moreSource§fn write_length_prefix(&mut self, len: usize)
fn write_length_prefix(&mut self, len: usize)
hasher_prefixfree_extras
)Source§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
u128
into this hasher.Source§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
usize
into this hasher.Source§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
i128
into this hasher.Source§fn write_isize(&mut self, i: isize)
fn write_isize(&mut self, i: isize)
isize
into this hasher.