Struct blake2s_simd::blake2sp::State [−][src]
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
impl State
[src]
pub fn new() -> Self
[src]
Equivalent to State::default()
or Params::default().to_state()
.
pub fn update(&mut self, input: &[u8]) -> &mut Self
[src]
Add input to the hash. You can call update
any number of times.
pub fn finalize(&self) -> Hash
[src]
Finalize the state and return a Hash
. This method is idempotent, and calling it multiple
times will give the same result. It’s also possible to update
with more input in between.
pub fn count(&self) -> u64
[src]
Return the total number of bytes input so far.
Note that count
doesn’t include the bytes of the key block, if any.
It’s exactly the total number of input bytes fed to update
.
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,