Module bao::hash[][src]

Compute a Bao hash from some input bytes.

Example

let hash_at_once = bao::hash::hash(b"input bytes");

let mut hasher = bao::hash::Writer::new();
hasher.update(b"input");
hasher.update(b" ");
hasher.update(b"bytes");
let hash_incremental = hasher.finish();

assert_eq!(hash_at_once, hash_incremental);

Structs

Hash

A Bao hash, with constant-time equality.

Writer

An incremental hasher. This implementation is single-threaded.

Constants

HASH_SIZE

The size of a Hash.

Functions

hash

Hash a slice of input bytes all at once. If the std feature is enabled, as it is by default, this will use multiple threads via Rayon.