Hash a file by path. Single open + fstat to minimize syscalls.
Uses read() for small files, streaming read+hash for large files.
Replaced mmap with read()+fadvise for better cache behavior:
read() keeps data hot in L2/L3 cache, while mmap suffers page table
and TLB overhead for sequential single-pass workloads.
Parse a BSD-style tag line: “ALGO (filename) = hash”
Returns (expected_hash, filename, optional_bits).
bits is the hash length parsed from the algo name (e.g., BLAKE2b-256 -> Some(256)).
Check if parallel hashing is worthwhile for the given file paths.
Only uses rayon when files are individually large enough for the hash
computation to dominate over rayon overhead (thread pool init + work stealing).
For many small files (e.g., 100 × 100KB), sequential is much faster.