//! Hashing.
//!//! Sarkara use [`BLAKE2b`](https://blake2.net/),
//! it based on [`ChaCha`](https://en.wikipedia.org/wiki/ChaCha_(cipher)) stream cipher,
//! have good performance and security.
pubmodblake2;pubuseself::blake2::Blake2b;/// `Hash` trait.
pubtraitHash: Default {/// Digest length
constDIGEST_LENGTH:usize;/// Calculate hash.
fnhash<D>(&self, data:&[u8])-> D where D:From<Vec<u8>>;
}
/// `GenericHash` trait,
/// allow set output length and key.
pub trait GenericHash: Default + Hash {/// Set output length.
fnwith_size(&mutself, nn:usize)->&mutSelf;/// Set hash key.
fnwith_key(&mutself, key:&[u8])->&mutSelf;}