Hash file or directory recursively.
Powered by blake3
cryptographic hashing algorithm.
Install the command line interface executable or use the crate library.
Included in this repository is an example directory containing some sample files, a subdirectory and a symlink to test paq
functionality.
Installation requires cargo.
Run cargo install paq
.
Run paq [src]
to hash source file or directory.
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
.
```rust use paq;
let source = std::path::PathBuf::from("/path/to/source"); let ignorehidden = true; // .dir or .file let sourcehash: paq::ArrayString<64> = paq::hashsource(&source, ignorehidden);
println!("{}", source_hash); ```
```rust use paq;
let source = std::path::PathBuf::from("example"); let ignorehidden = true; let sourcehash: paq::ArrayString<64> = paq::hashsource(&source, ignorehidden);
asserteq!(&sourcehash[..], "494f366c528a930bb654b58721ab01683146381e1d2bf3e187311f9b725bfa19"); ```
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.