hashdir2
A fast, parallel, multi-algorithm directory hashing library and CLI.
hashdir2 provides both a library and a command-line tool for hashing directories
recursively using multiple algorithms. It is designed to be efficient, deterministic,
and suitable for use in automated environments such as CI/CD pipelines.
Overview
- Recursive directory traversal
- Parallel hashing using rayon
- Multiple algorithms: SHA-2, BLAKE2, BLAKE3, MD5
- Memory-mapped I/O for large files
- Deterministic output
- Optional CLI with progress indication and verification
[!IMPORTANT]
This library is very raw and there are could be some critical bugs not found yet. Keep that in mind when working with it.
Installation
Library
Add to Cargo.toml:
[]
= "0.1"
Command-line tool
To install the CLI binary:
After installation:
Example (library)
use Blake3Hasher;
use ;
Example (CLI)
Hash a directory:
Select algorithm:
Verify against a known hash:
Output in base64:
Feature flags
| Feature | Description |
|---|---|
default |
Enables the cli feature |
cli |
Enables the command-line interface and dependencies (clap, indicatif, hex, base64) |
Example disabling the CLI:
[]
= { = "0.1", = false }
Roadmap?
- Cover everything with unit-tests to make the library behaviour more predictable
- Add glob pattern matching
- Add symlink follow behaviour
License
Licensed under MIT license (LICENSE)