pub struct RawHasher<S>(/* private fields */);
Available on crate feature
xxhash3_128
only.Expand description
A lower-level interface for computing a hash from streaming data.
The algorithm requires a secret which can be a reasonably large
piece of data. Hasher
makes one concrete implementation
decision that uses dynamic memory allocation, but specialized
usages may desire more flexibility. This type, combined with
SecretBuffer
, offer that flexibility at the cost of a
generic type.
Implementations§
Source§impl<S> RawHasher<S>
impl<S> RawHasher<S>
Sourcepub fn new(secret_buffer: SecretBuffer<S>) -> Self
pub fn new(secret_buffer: SecretBuffer<S>) -> Self
Construct the hasher with the provided seed, secret, and temporary buffer.
Sourcepub fn into_secret(self) -> S
pub fn into_secret(self) -> S
Returns the secret.
Source§impl<S> RawHasher<S>where
S: FixedBuffer,
impl<S> RawHasher<S>where
S: FixedBuffer,
Sourcepub fn finish_128(&self) -> u128
pub fn finish_128(&self) -> u128
Returns the hash value for the values written so
far. Unlike std::hash::Hasher::finish
, this method
returns the complete 128-bit value calculated, not a
64-bit value.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for RawHasher<S>where
S: Freeze,
impl<S> RefUnwindSafe for RawHasher<S>where
S: RefUnwindSafe,
impl<S> Send for RawHasher<S>where
S: Send,
impl<S> Sync for RawHasher<S>where
S: Sync,
impl<S> Unpin for RawHasher<S>where
S: Unpin,
impl<S> UnwindSafe for RawHasher<S>where
S: UnwindSafe,
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