Struct exonum::crypto::HashStream
[−]
[src]
pub struct HashStream(_);
This structure provides a possibility to calculate a SHA-256 hash digest for a stream of data.
Example
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();
Methods
impl HashStream
[src]
pub fn new() -> Self
[src]
Creates a new instance of HashStream
.
pub fn update(self, chunk: &[u8]) -> Self
[src]
Processes a chunk of stream and returns a HashStream
with the updated internal state.
pub fn hash(self) -> Hash
[src]
Returns the hash of data supplied to the stream so far.
Trait Implementations
impl Debug for HashStream
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for HashStream
[src]
fn default() -> HashStream
[src]
Returns the "default value" for a type. Read more