pub fn hash_file(algo: HashAlgorithm, path: &Path) -> Result<String>Expand description
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.