Module bao::hash

source ·
Expand description

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

A Bao hash, with constant-time equality.
An incremental hasher. This implementation is single-threaded.

Constants

The size of a Hash.

Functions

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.