| Crates.io | paq |
| lib.rs | paq |
| version | 1.4.1 |
| created_at | 2021-12-17 20:47:49.447737+00 |
| updated_at | 2025-12-29 23:17:26.351202+00 |
| description | Hash file or directory recursively. |
| homepage | https://crates.io/crates/paq |
| repository | https://github.com/gregl83/paq |
| max_upload_size | |
| id | 499754 |
| size | 406,841 |
Hash file or directory recursively.
Powered by blake3 cryptographic hashing algorithm.
The Go programming language repository was used as a test data source (157 MB / 14,490 files).
| Tool | Version | Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|---|---|
| paq | latest | paq ./go |
77.7 ± 0.6 | 77.1 | 80.2 | 1.00 |
| b3sum | 1.5.1 | find ./go ... b3sum |
327.3 ± 3.6 | 320.2 | 332.3 | 4.21 ± 0.05 |
| dirhash | 0.5.0 | dirhash -a sha256 ./go |
576.1 ± 2.9 | 570.8 | 580.3 | 7.41 ± 0.06 |
| GNU sha2 | 9.7 | find ./go ... sha256sum |
725.2 ± 43.5 | 692.2 | 813.2 | 9.33 ± 0.56 |
| folder-hash | 4.1.1 | folder-hash ./go |
1906.0 ± 78.0 | 1810.0 | 2029.0 | 24.53 ± 1.02 |
See benchmarks documentation for more details.
Windows, macOS, and Ubuntu are supported.
.zip archive matching your OS and Architecture..zip archive to retrieve the paq binary.paq binary executable (e.g., chmod +x) and move it to a directory in your system PATH.paq --version from the Command Line Interface.Requires the cargo package manager.
cargo install paq
Not recommended due to instability of main branch in-between tagged releases.
cargo install --path . from repository root.Requires nix and the nix-command experimental feature to be enabled.
nix profile add github:gregl83/paq
Support for Python is available in the paqpy package.
Command Line Interface executable or Crate library.
Included in this repository is an example directory containing some sample files, a subdirectory and a symlink to test paq functionality.
Run paq [src] to hash source file or directory.
Output hash to .paq file as valid JSON.
For help, run paq --help.
paq ./example
Path to example directory can be relative or absolute.
Expect different results if -i or --ignore-hidden flag argument is used.
Add paq to project dependencies in Cargo.toml.
use paq;
let source = std::path::PathBuf::from("/path/to/source");
let ignore_hidden = true; // .dir or .file
let source_hash: paq::ArrayString<64> = paq::hash_source(&source, ignore_hidden);
println!("{}", source_hash);
use paq;
let source = std::path::PathBuf::from("example");
let ignore_hidden = true;
let source_hash: paq::ArrayString<64> = paq::hash_source(&source, ignore_hidden);
assert_eq!(&source_hash[..], "d7d25c9b2fdb7391e650085a985ad0d892c7f0dd5edd32c7ccdb4b0d1c34c430");
Expect different results if ignore_hidden is set to false.
Hashes are generated using file system content as input data to the blake3 hashing algorithm.
By design, paq does NOT include file system metadata in hash input such as:
Additionally, files or directory contents starting with dot or full stop can optionally be ignored.