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]

Formats the value using the given formatter.

impl Clone for Blake2b
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Blake2b
[src]

Returns the "default value" for a type. Read more

impl Hash for Blake2b
[src]

Digest length.

Calculate hash.

impl GenericHash for Blake2b
[src]

Set output length.

Set hash key.