Function crypto_hash::hex_digest [] [src]

pub fn hex_digest(algorithm: Algorithm, data: Vec<u8>) -> String

Helper function for Hasher which generates a cryptographic digest serialized in hexadecimal from the given data and algorithm.

Examples

use crypto_hash::{Algorithm, hex_digest};

let data = b"crypto-hash".to_vec();
let result = hex_digest(Algorithm::SHA256, data);
let expected = "fd1afb6022cd4d47c890961c533928eacfe8219f1b2524f7fb2a61847ddf8c27";
assert_eq!(expected, result)