blazehash 0.2.0

Forensic file hasher — hashdeep for the modern era, BLAKE3 by default
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use anyhow::Result;
use blazehash::forensic_image::verify_image;
use blazehash::output::make_writer;
use std::io::Write;
use std::path::PathBuf;

pub fn run(paths: &[PathBuf], output: Option<&PathBuf>) -> Result<()> {
    let mut writer = make_writer(output.map(|p| p.as_path()), false)?;

    for path in paths {
        let result = verify_image(path)?;
        write!(writer, "{result}")?;
    }

    writer.flush()?;
    Ok(())
}