Skip to main content

hash_files_batch

Function hash_files_batch 

Source
pub fn hash_files_batch(
    paths: &[&Path],
    algo: HashAlgorithm,
) -> Vec<Result<String>> 
Expand description

Batch-hash multiple files: pre-read all files into memory in parallel, then hash all data in parallel. Optimal for many small files where per-file overhead (open/read/close syscalls) dominates over hash computation.

Reuses the same parallel file loading pattern as blake2b_hash_files_many(). For 100 × 55-byte files: all 5500 bytes are loaded in parallel across threads, then hashed in parallel — minimizing wall-clock time for syscall-bound workloads. Returns results in input order.