Struct xxhash2::State64
[−]
[src]
pub struct State64 { /* fields omitted */ }
Representation of the intermediate state of a 64-bit xxHash instance.
This structure can be used to generate a 64-bit hash of a block of bytes.
Methods
impl State64
[src]
fn new() -> State64
Creates a new blank instance of the 64-bit xxHash state.
This state can then be used to hash a list of bytes and acquire the
result via the finish
method.
Examples
let state = xxhash2::State64::new();
fn update(&mut self, data: &[u8])
Input a block of bytes into this hasher.
This function will update the internal state of this hasher with a new
list of bytes to feed in. To get the hash value of the block (and all
previous bytes), call the finish
function.
Examples
let mut state = xxhash2::State64::new(); state.update(&[1, 2, 3, 4]);
fn reset(&mut self, seed: u64)
Reset the internal state of this hasher with a given seed.
This is useful to reuse a hasher or to persist the state across multiple runs of a hasher.
Examples
let mut state = xxhash2::State64::new(); state.update(&[1, 2, 3, 4]);
fn finish(&self) -> u64
Computes the final hash result of all bytes that have been input to this hasher.
Returns the 64-bit checksum of the result.
Examples
let mut state = xxhash2::State64::new(); state.update(&[1, 2, 3, 4]); assert_eq!(state.finish(), 6063570110359613137);
Trait Implementations
impl Hasher for State64
[src]
fn write(&mut self, data: &[u8])
Writes some data into this Hasher
. Read more
fn finish(&self) -> u64
Completes a round of hashing, producing the output hash generated. Read more
fn write_u8(&mut self, i: u8)
1.3.0
Writes a single u8
into this hasher.
fn write_u16(&mut self, i: u16)
1.3.0
Writes a single u16
into this hasher.
fn write_u32(&mut self, i: u32)
1.3.0
Writes a single u32
into this hasher.
fn write_u64(&mut self, i: u64)
1.3.0
Writes a single u64
into this hasher.
fn write_u128(&mut self, i: u128)
i128
)Writes a single u128
into this hasher.
fn write_usize(&mut self, i: usize)
1.3.0
Writes a single usize
into this hasher.
fn write_i8(&mut self, i: i8)
1.3.0
Writes a single i8
into this hasher.
fn write_i16(&mut self, i: i16)
1.3.0
Writes a single i16
into this hasher.
fn write_i32(&mut self, i: i32)
1.3.0
Writes a single i32
into this hasher.
fn write_i64(&mut self, i: i64)
1.3.0
Writes a single i64
into this hasher.
fn write_i128(&mut self, i: i128)
i128
)Writes a single i128
into this hasher.
fn write_isize(&mut self, i: isize)
1.3.0
Writes a single isize
into this hasher.
impl Clone for State64
[src]
fn clone(&self) -> State64
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more