media_analyzer 0.9.0

Extract file-based information from photo and video files.
1
2
3
4
5
6
7
8
9
10
11
use std::io;
use std::path::Path;

/// Computes the BLAKE3 hash of a file.
pub fn hash_file(path: &Path) -> io::Result<String> {
    let mut hasher = blake3::Hasher::new();
    hasher.update_mmap_rayon(path)?;

    let hash = hasher.finalize();
    Ok(hash.to_hex().to_string())
}