Crate blake2 [−] [src]
An implementation of the BLAKE2 hash functions.
Based on the work of Cesar Barros.
Usage
An example of using Blake2b
is:
use blake2::{Blake2b, Digest}; // create a Blake2b object let mut hasher = Blake2b::default(); // write input message hasher.input(b"hello world"); // read hash digest and consume hasher let output = hasher.result(); println!("{:x}", output);
Same for Blake2s
:
use blake2::{Blake2s, Digest}; let mut hasher = Blake2s::default(); hasher.input(b"hello world"); let output = hasher.result(); println!("{:x}", output);
Structs
Blake2b |
Hash function context. |
Blake2s |
Hash function context. |
Traits
Digest |
The Digest trait specifies an interface common to digest functions. It's a
convinience wrapper around |