pub struct Hasher { /* private fields */ }
xxhash3_128
only.Expand description
Calculates the 128-bit hash. TODO: does not implement hash.
Implementations§
Source§impl Hasher
impl Hasher
Sourcepub fn new() -> Self
Available on crate feature alloc
only.
pub fn new() -> Self
alloc
only.Constructs the hasher using the default seed and secret values.
Sourcepub fn with_seed(seed: u64) -> Self
Available on crate feature alloc
only.
pub fn with_seed(seed: u64) -> Self
alloc
only.Constructs the hasher using the provided seed and a secret derived from the seed.
Sourcepub fn with_seed_and_secret(
seed: u64,
secret: impl Into<Box<[u8]>>,
) -> Result<Self, SecretTooShortError<Box<[u8]>>>
Available on crate feature alloc
only.
pub fn with_seed_and_secret( seed: u64, secret: impl Into<Box<[u8]>>, ) -> Result<Self, SecretTooShortError<Box<[u8]>>>
alloc
only.Constructs the hasher using the provided seed and secret.
Sourcepub fn into_secret(self) -> Box<[u8]>
Available on crate feature alloc
only.
pub fn into_secret(self) -> Box<[u8]>
alloc
only.Returns the secret.
Sourcepub fn write(&mut self, input: &[u8])
Available on crate feature alloc
only.
pub fn write(&mut self, input: &[u8])
alloc
only.Writes some data into this Hasher
.
Sourcepub fn finish_128(&self) -> u128
Available on crate feature alloc
only.
pub fn finish_128(&self) -> u128
alloc
only.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.
Source§impl Hasher
impl Hasher
Sourcepub fn oneshot(input: &[u8]) -> u128
pub fn oneshot(input: &[u8]) -> u128
Hash all data at once. If you can use this function, you may see noticable speed gains for certain types of input.
Sourcepub fn oneshot_with_seed(seed: u64, input: &[u8]) -> u128
pub fn oneshot_with_seed(seed: u64, input: &[u8]) -> u128
Hash all data at once using the provided seed and a secret derived from the seed. If you can use this function, you may see noticable speed gains for certain types of input.
Sourcepub fn oneshot_with_secret(
secret: &[u8],
input: &[u8],
) -> Result<u128, OneshotWithSecretError>
pub fn oneshot_with_secret( secret: &[u8], input: &[u8], ) -> Result<u128, OneshotWithSecretError>
Hash all data at once using the provided secret and the default seed. If you can use this function, you may see noticable speed gains for certain types of input.
Sourcepub fn oneshot_with_seed_and_secret(
seed: u64,
secret: &[u8],
input: &[u8],
) -> Result<u128, OneshotWithSecretError>
pub fn oneshot_with_seed_and_secret( seed: u64, secret: &[u8], input: &[u8], ) -> Result<u128, OneshotWithSecretError>
Hash all data at once using the provided seed and secret. If you can use this function, you may see noticable speed gains for certain types of input.