pub struct HashStream(/* private fields */);
Expand description
This structure provides a possibility to calculate a hash digest
for a stream of data. Unlike the
Hash
structure,
the given structure lets the code process several data chunks without
the need to copy them into a single buffer.
§Examples
The example below indicates the data the code is working with; runs the system hash update as many times as required to process all the data chunks and calculates the resulting hash of the system.
use exonum_crypto::HashStream;
let data: Vec<[u8; 5]> = vec![[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]];
let mut hash_stream = HashStream::new();
for chunk in data {
hash_stream = hash_stream.update(&chunk);
}
let _ = hash_stream.hash();
Implementations§
Trait Implementations§
Source§impl Debug for HashStream
impl Debug for HashStream
Source§impl Default for HashStream
impl Default for HashStream
Source§fn default() -> HashStream
fn default() -> HashStream
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HashStream
impl RefUnwindSafe for HashStream
impl Send for HashStream
impl Sync for HashStream
impl Unpin for HashStream
impl UnwindSafe for HashStream
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