0.1.0-rc3 |
|
---|---|
0.1.0-rc2 |
|
Used in 2 crates
4KB
chksum
Simple checksum calculator - for people who wants to make checksum of whole directory but doesn't like piping.
find /path -type f -exec md5sum \{\} + | sort -k1 | md5sum
Running by a CLI
Installation
cargo install chksum-cli
Usage
chksum-cli [options] [--] <path>...
Like
$ chksum-cli LICENSE
3b7c11a62208f03df96f7cfe215b1e28 LICENSE
$ md5sum LICENSE
3b7c11a62208f03df96f7cfe215b1e28 LICENSE
$ chksum-cli --hash SHA1 chksum/ chksum-cli/docs/
c244b8c851d881b8fd2856004e90732bd129cf21 chksum/
5d2c74c21711676e39963098746a3498d29aa3e5 chksum-cli/docs/
$ find chksum-cli/docs/ -type f | sort | xargs cat | sha1sum
5d2c74c21711676e39963098746a3498d29aa3e5 -
Check chksum-cli/README.md
for more.
Using as a library
Add to your project
cargo add chksum
Use
Code example.
use chksum::prelude::*;
let digest = File::open("path/to/file")?.chksum(HashAlgorithm::MD5)?;
println!("digest {:x}", digest);
Check chksum/README.md
for more.
Hash algorithms
Implemented hash algorithms:
- MD5 - RFC 1321: The MD5 Message-Digest Algorithm
- SHA-1 - RFC 3174: US Secure Hash Algorithm 1 (SHA1)
- SHA-2 family (SHA-224, SHA-256, SHA-386, SHA-512) - FIPS PUB 180-4: Secure Hash Standard
Disclaimer
Code is under development. The interface, both for library and application, may change in the future.