@lowdep/hashsum
v1.0.0
Published
Compute and verify file checksums (md5/sha1/sha256/sha512) with a consistent cross-platform interface — zero dependencies
Maintainers
Readme
hashsum
Compute and verify file checksums with one consistent interface on every OS. Supports MD5, SHA-1, SHA-256, and SHA-512. Zero dependencies.
No more remembering sha256sum (Linux) vs shasum -a 256 (macOS) vs certutil -hashfile / Get-FileHash (Windows) — all of which print different formats.
Install
npm install -g hashsumOr without installing:
npx hashsum file.zipUsage
hashsum file.zip # SHA-256 (default)
hashsum *.iso -a sha512 # SHA-512 of several files
hashsum dist/* --save # Write sha256sums.txt
hashsum -c sha256sums.txt # Verify files against the list
hashsum --string "hello" -a md5 # Hash a literal stringOutput Format
Matches sha256sum, so the files are interoperable:
$ hashsum archive.tar.gz
9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 archive.tar.gzVerify Downloads
Generate a checksum list:
hashsum *.iso -a sha256 --save # → sha256sums.txtVerify later (the algorithm is auto-detected from each hash's length):
$ hashsum -c sha256sums.txt
hashsum verifying 3 file(s) from sha256sums.txt
✓ OK ubuntu.iso
✗ FAILED corrupted.iso
? MISSING deleted.iso
1 OK · 1 failed · 1 missingExit code is 1 if any file fails or is missing — so it works in CI and scripts.
Supported Algorithms
| Algorithm | Hash length | Notes |
|---|---|---|
| md5 | 32 hex | Fast, not for security |
| sha1 | 40 hex | Legacy |
| sha256 | 64 hex | Default — the modern standard |
| sha512 | 128 hex | Stronger / faster on 64-bit |
When verifying with -c, the algorithm is inferred from each hash's length, so a mixed file works.
Options
| Flag | Description |
|---|---|
| -a, --algo <name> | md5 | sha1 | sha256 | sha512 |
| -c, --check <file> | Verify files listed in a checksums file |
| --string <text> | Hash a string instead of a file |
| --save | Write <algo>sums.txt |
| --json | JSON output |
| --quiet | Print only the hash / exit code |
License
MIT
Keywords
checksum · sha256 · md5 · file hash · sha256sum windows · verify checksum · sha512 · integrity check · cross-platform · zero dependencies
Built to solve, shared to help — Rushabh Shah 🛠️✨
One of 40+ zero-dependency developer CLI tools — no node_modules, ever.
