hash_file/hash_file.rs
1use std::env;
2
3use hashjunkie::{Algorithm, hash_file};
4
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 let path = env::args()
7 .nth(1)
8 .expect("usage: cargo run -p hashjunkie --example hash_file -- PATH");
9 let result = hash_file(path, &[Algorithm::Blake3, Algorithm::Sha256])?;
10
11 for (algorithm, digest) in &result {
12 println!("{algorithm}: {}", digest.standard());
13 }
14
15 Ok(())
16}