Skip to main content

hexdigest

Function hexdigest 

Source
pub fn hexdigest(data: &[u8]) -> String
Expand description

One-shot digest of data.

Examples found in repository?
examples/p6_soak.rs (line 31)
23fn store_hashes(cache: &Path, key: &str) -> Vec<(String, String)> {
24    let mut hashes: Vec<(String, String)> = fs::read_dir(store_dir(cache, key))
25        .expect("read persisted store")
26        .map(|entry| {
27            let entry = entry.expect("read store entry");
28            let bytes = fs::read(entry.path()).expect("read store segment");
29            (
30                entry.file_name().to_string_lossy().into_owned(),
31                rac_engine::sha256::hexdigest(&bytes),
32            )
33        })
34        .collect();
35    hashes.sort();
36    hashes
37}