pub fn fingerprint<H: Update + FixedOutput + Default>(
value: impl Fingerprint,
) -> Output<H>
Expand description
Calculate the cryptographic hash of a data structure using the default hasher of a given type.
ยงExamples
use sha2::Sha512;
use fingerprint_struct::{fingerprint, Fingerprint};
let hash = fingerprint::<Sha512>("Hello world!");
println!("{hash:?}");
use blake2::Blake2b512;
use fingerprint_struct::{fingerprint, Fingerprint};
let hash = fingerprint::<Blake2b512>("Hello world!");
println!("{hash:?}");