blazehash 0.2.5

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
use anyhow::Result;
use std::io::Write;
use std::path::Path;

pub fn count_entries(manifest_path: &Path, out: &mut impl Write) -> Result<()> {
    let content = std::fs::read_to_string(manifest_path)?;
    let n = content.lines().filter(|l| {
        let t = l.trim();
        !t.is_empty() && !t.starts_with('#') && !t.starts_with('%')
    }).count();
    writeln!(out, "{n}")?;
    Ok(())
}