Struct autobahn_hash::AutobahnHasher
source · pub struct AutobahnHasher { /* private fields */ }
Expand description
A hash instance.
For maximum performance, use this hasher in a larger code block compiled with SIMD target features enabled.
Implementations§
source§impl AutobahnHasher
impl AutobahnHasher
sourcepub fn new_with_key(key: [u64; 4]) -> Self
pub fn new_with_key(key: [u64; 4]) -> Self
Create a new AutobahnHasher
with the given key.
sourcepub fn write_packet(&mut self, packet: [u64; 4])
pub fn write_packet(&mut self, packet: [u64; 4])
Write a packet of data to the hasher.
sourcepub fn write_bytes(&mut self, bytes: [u8; 32])
pub fn write_bytes(&mut self, bytes: [u8; 32])
Write a packet of data to the hasher, in the form of bytes.
sourcepub fn finish_64(self, remainder: &[u8]) -> u64
pub fn finish_64(self, remainder: &[u8]) -> u64
Produce a 64-bit hash.
The remainder
bytes must be less than a packet (less than 32 bytes).
Writing the remainder is notably different than Hasher::write
. The remainder is padded
and permuted into a 32-byte packet.
Panics
Panics if remainder is not less than 32 bytes.
sourcepub fn finish_128(self, remainder: &[u8]) -> [u64; 2]
pub fn finish_128(self, remainder: &[u8]) -> [u64; 2]
Produce a 128-bit hash.
The remainder
bytes must be less than a packet (less than 32 bytes).
Writing the remainder is notably different than Hasher::write
. The remainder is padded
and permuted into a 32-byte packet.
Panics
Panics if remainder is not less than 32 bytes.
sourcepub fn finish_256(self, remainder: &[u8]) -> [u64; 4]
pub fn finish_256(self, remainder: &[u8]) -> [u64; 4]
Produce a 256-bit hash.
The remainder
bytes must be less than a packet (less than 32 bytes).
Writing the remainder is notably different than Hasher::write
. The remainder is padded
and permuted into a 32-byte packet.
Panics
Panics if remainder is not less than 32 bytes.
Trait Implementations§
source§impl Clone for AutobahnHasher
impl Clone for AutobahnHasher
source§fn clone(&self) -> AutobahnHasher
fn clone(&self) -> AutobahnHasher
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AutobahnHasher
impl Debug for AutobahnHasher
source§impl Default for AutobahnHasher
impl Default for AutobahnHasher
source§impl Hasher for AutobahnHasher
impl Hasher for AutobahnHasher
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_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
u128
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
)