pub struct RawHasher<S> { /* private fields */ }
Available on crate feature
xxhash3_64
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.
Trait Implementations§
Source§impl<S> Hasher for RawHasher<S>where
S: FixedBuffer,
impl<S> Hasher for RawHasher<S>where
S: FixedBuffer,
1.26.0 · Source§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
Writes a single
u128
into this hasher.1.3.0 · Source§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
Writes a single
usize
into this hasher.1.26.0 · Source§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
Writes a single
i128
into this hasher.1.3.0 · Source§fn write_isize(&mut self, i: isize)
fn write_isize(&mut self, i: isize)
Writes a single
isize
into this hasher.Source§fn write_length_prefix(&mut self, len: usize)
fn write_length_prefix(&mut self, len: usize)
🔬This is a nightly-only experimental API. (
hasher_prefixfree_extras
)Writes a length prefix into this hasher, as part of being prefix-free. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)