For people who wants to make checksum of whole directory but doesn't like piping.
$ find /path -type f -exec md5sum \{\} + | sort -k1 | md5sum
$ cargo install chksum-cli
$ chksum-cli [options] [--] <path>...
Like
$ chksum-cli LICENSE
3b7c11a62208f03df96f7cfe215b1e28 LICENSE
$ md5sum LICENSE
3b7c11a62208f03df96f7cfe215b1e28 LICENSE
$ chksum-cli --hash SHA1 docs/ extra/
bc6f0730053530230d6a205309acb606d51130b7 docs/
eb6d3cb291b58ebed93893848b3549264f01290b extra/
$ find docs/ -type f | sort | xargs cat | sha1sum
bc6f0730053530230d6a205309acb606d51130b7 -
See chksum-cli/README.md
for more.
See chksum/README.md
for more.
Enable sync
feature during installation.
$ cargo install chksum[sync]
Code example.
use chksum::arch::x1::Arch;
use chksum::hash::md5;
use chksum::prelude::*;
let mut hash = md5::Hash::<Arch>::new();
let digest = "path/to/file".chksum(&mut hash)?;
println!("digest {:x}", digest);
Enable async
feature during installation.
$ cargo install chksum[async]
Code example.
use chksum::arch::x1::Arch;
use chksum::hash::md5;
use chksum::prelude::*;
let mut hash = md5::Hash::<Arch>::new();
let digest = "path/to/file".chksum(&mut hash).await?;
println!("digest {:x}", digest);
Currently there are implemented two hash algorithms: