pub trait Fingerprint {
// Required method
fn fingerprint(&self) -> Result<Fp>;
}Expand description
Computes a content-based fingerprint for a file.
Implemented on Path to hash the full file contents using BLAKE3,
producing a stable 32-byte digest that is independent of filesystem
metadata such as modification time or file size.
§Hashing strategy
The implementation selects between two BLAKE3 strategies based on file size:
-
< 10 MiB —
update_reader: plain buffered sequential read. Avoids mmap syscall overhead for small files. On slow storage, a single sequentialread()into a buffer is faster than taking page faults through a memory mapping. The typical e-book (100 KiB–500 KiB) falls into this range. -
≥ 10 MiB —
update_mmap: single-threaded memory-mapped hashing. Avoids buffered-read overhead for large files while keeping CPU usage on a single core.