| Crates.io | chksum-cli |
| lib.rs | chksum-cli |
| version | 0.4.2 |
| created_at | 2022-03-01 17:38:53.75208+00 |
| updated_at | 2025-01-02 18:18:06.284425+00 |
| description | A simple checksum calculator. |
| homepage | |
| repository | https://github.com/chksum-rs/cli |
| max_upload_size | |
| id | 541692 |
| size | 71,495 |
A simple checksum calculator.
Various tools like md5sum, sha1sum, b2sum, sha224sum, etc., allow users to calculate file-based hash digests. However, these tools focus on file-level checksums, making it cumbersome to handle scenarios like calculating digests of whole directories. This motivated the creation of chksum to offer a simplified interface for such use cases.
find dir/ -type f | sort | xargs cat | sha224sum
With chksum, you can achieve the same result with your preferred hash algorithm:
chksum sha2-224 dir/
Install the chksum binary using cargo install:
cargo install chksum-cli
$ chksum help
A simple checksum calculator.
Usage: chksum [OPTIONS] <COMMAND>
Commands:
md5 Calculate MD5 digest
sha1 Calculate SHA-1 digest
sha2-224 Calculate SHA-2 224 digest
sha2-256 Calculate SHA-2 256 digest
sha2-384 Calculate SHA-2 384 digest
sha2-512 Calculate SHA-2 512 digest
help Print this message or the help of the given subcommand(s)
Options:
-c, --color <COLOR> Show colored output [default: auto] [possible values: always, auto, never]
-h, --help Print help
-V, --version Print version
$ chksum help sha2-224
Calculate SHA-2 224 digest
Usage: chksum sha2-224 [OPTIONS] <PATH>...
Arguments:
<PATH>... Path to file or directory
Options:
-s, --stdin Calculate digest from stdin
-c, --color <COLOR> Show colored output [default: auto] [possible values: always, auto, never]
-h, --help Print help
$ chksum sha2-224 LICENSE
LICENSE: f2c3541b130a29abc5400732a573ba11a3a30a09435d3c1f15a83f77
$ chksum sha1 src/
src/: 65393d65360ae9915e50224ee0f49fa58cff9abd
$ echo -n admin1 | chksum md5 --stdin
<stdin>: e00cf25ad42683b3df678c61f42c6bda
Check out the chksum crate to see the library that allows you to calculate digests of files and directories with an easy-to-use interface.
This binary provides implementations for the following hash algorithms:
md5: Enables MD5 hash algorithm.sha1: Enables SHA-1 hash algorithm.sha2: Enables SHA-2 hash family algorithms.
sha2-224: Enables only SHA-2 224 hash algorithm.sha2-256: Enables only SHA-2 256 hash algorithm.sha2-384: Enables only SHA-2 384 hash algorithm.sha2-512: Enables only SHA-2 512 hash algorithm.By default, all of them are enabled.
color: Enables colored output.By default, all of them are enabled.
The code is under development, and the interface may change in the future.
This crate is licensed under the MIT License.