hash-check-cli
v1.0.0
Published
CLI tool for computing file hashes (MD5/SHA1/SHA256/SHA512). Supports batch files, output to file, and verification mode. Zero dependencies.
Maintainers
Readme
🔐 hash-check-cli
A zero-dependency CLI tool for computing and verifying file hashes. Supports MD5, SHA1, SHA256, and SHA512 with batch processing and multiple output formats.
Install
npm install -g hash-check-cliUsage
# Compute SHA256 of a file (default)
hash-check file.zip
# Use a specific algorithm
hash-check file.iso -a md5
hash-check file.bin -a sha512
# Compute all supported algorithms at once
hash-check -A document.pdf
# Batch process multiple files
hash-check *.tar.gz
# Verify a hash
hash-check file.zip --verify "d41d8cd98f00b204e9800998ecf8427e"
# Write hashes to a file
hash-check *.dmg -o checksums.md5
# sha256sum-compatible output
hash-check *.tar.gz --sha256sum -o sha256sums.txtExamples
# Single file
$ hash-check ubuntu-24.04.iso
SHA256 a1b2c3d4e5f6... ubuntu-24.04.iso
# All hashes
$ hash-check -A important.pdf
── 1 file(s) — All algorithms ──────────────────
MD5 d41d8cd98f00b204e9800998ecf8427e important.pdf (2.3 MB)
SHA1 356a192b7913b04c54574d18c28d46e6395428ab important.pdf
SHA256 a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3 important.pdf
SHA512 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e important.pdf
# Verification
$ hash-check file.zip -v a1b2c3d4e5f6a7b8...
✅ file.zip: SHA256 hash MATCHES
# Batch output
$ hash-check *.txt -o hashes.txt
SHA256 123abc... readme.txt
SHA256 def789... notes.txt
Hash file written: hashes.txtOptions
| Option | Alias | Description |
|--------|-------|-------------|
| --algorithm <algo> | -a | Hash algorithm: md5, sha1, sha256, sha512 (default: sha256) |
| --all | -A | Compute all supported algorithms |
| --verify <hash> | -v | Verify a hash against the file |
| --output <file> | -o | Write hashes to a file |
| --sha256sum | | Output in sha256sum-compatible format |
| --json | -j | JSON output |
| --help | -h | Show help |
Features
- ✅ Pure Node.js — uses built-in
cryptomodule, zero dependencies - ✅ Multiple algorithms — MD5, SHA1, SHA256, SHA512
- ✅ Batch processing — glob patterns for multiple files
- ✅ Hash verification — check a file against an expected hash
- ✅ Output to file — save checksums in standard or sha256sum format
- ✅ JSON output — machine-readable format for scripting
- ✅ File size display — shown alongside hashes in verbose mode
License
MIT
