pub struct Hasher { /* private fields */ }
xxhash3_64
only.Expand description
Calculates the 64-bit 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.
Source§impl Hasher
impl Hasher
Sourcepub fn oneshot(input: &[u8]) -> u64
pub fn oneshot(input: &[u8]) -> u64
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]) -> u64
pub fn oneshot_with_seed(seed: u64, input: &[u8]) -> u64
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<u64, OneshotWithSecretError>
pub fn oneshot_with_secret( secret: &[u8], input: &[u8], ) -> Result<u64, 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<u64, OneshotWithSecretError>
pub fn oneshot_with_seed_and_secret( seed: u64, secret: &[u8], input: &[u8], ) -> Result<u64, 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.
Trait Implementations§
Source§impl Hasher for Hasher
Available on crate feature alloc
only.
impl Hasher for Hasher
alloc
only.1.26.0 · Source§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
u128
into this hasher.1.3.0 · Source§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
usize
into this hasher.1.26.0 · Source§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
i128
into this hasher.1.3.0 · Source§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
)