Skip to main content

calc_hash

Macro calc_hash 

Source
macro_rules! calc_hash {
    ( $( $x:expr ),* ) => { ... };
}
Expand description

Easy way to feed an arbitrary amount of data into the Hasher and retrieving its result.

ยงExamples

let hash = calc_hash!(b"hash", b"over", b"some", b"amount", b"of", b"data");

Which is equivalent to:

let mut hasher = Hasher::new();
hasher.update(b"hash");
hasher.update(b"over");
hasher.update(b"some");
hasher.update(b"amount");
hasher.update(b"of");
hasher.update(b"data");
let hash = hasher.finalize();