Struct sarkara::hash::Blake2b
[−]
[src]
pub struct Blake2b { /* fields omitted */ }
Blake2b.
Example(hash)
use sarkara::hash::{ Blake2b, Hash }; assert_eq!( Blake2b::default().hash::<Vec<u8>>(&[]), &[ 120, 106, 2, 247, 66, 1, 89, 3, 198, 198, 253, 133, 37, 82, 210, 114, 145, 47, 71, 64, 225, 88, 71, 97, 138, 134, 226, 23, 247, 31, 84, 25, 210, 94, 16, 49, 175, 238, 88, 83, 19, 137, 100, 68, 147, 78, 176, 75, 144, 58, 104, 91, 20, 72, 183, 85, 213, 111, 112, 26, 254, 155, 226, 206 ][..] );
Example(with_size/with_key)
use sarkara::hash::{ Blake2b, Hash, GenericHash }; assert_eq!( Blake2b::default() .with_size(16) .with_key(&[5; 16]) .hash::<Vec<u8>>(&[]), &[ 148, 148, 166, 38, 121, 23, 19, 81, 108, 248, 28, 149, 40, 170, 25, 209 ] );
Trait Implementations
impl Debug for Blake2b
[src]
impl Clone for Blake2b
[src]
fn clone(&self) -> Blake2b
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Default for Blake2b
[src]
impl Hash for Blake2b
[src]
fn digest_length() -> usize
Digest length.
fn hash<D>(&self, data: &[u8]) -> D where D: From<Vec<u8>>
Calculate hash.