Struct blake2s_simd::blake2sp::State
source · pub struct State { /* private fields */ }
Expand description
An incremental hasher for BLAKE2sp, just like the State
type for
BLAKE2s.
Example
use blake2s_simd::blake2sp;
let mut state = blake2sp::State::new();
state.update(b"foo");
state.update(b"bar");
let hash = state.finalize();
let expected = "268120e51df583c61d6bfb7915f1c8ead299696c42f413092cd0b2247e1a388d";
assert_eq!(expected, &hash.to_hex());
Implementations§
source§impl State
impl State
sourcepub fn update(&mut self, input: &[u8]) -> &mut Self
pub fn update(&mut self, input: &[u8]) -> &mut Self
Add input to the hash. You can call update
any number of times.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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