1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Hash.

use zeroize::Zeroize;

/// Trait represents Hash.
pub trait Hash: Zeroize {
    /// Create new hasher.
    fn new() -> Self;

    /// Update state using the provided data.
    fn update(&mut self, data: &[u8]);

    /// Retrieve result and consume hasher instance.
    fn finalize(self) -> Vec<u8>;
}