
sha256sum, shasum, Get-FileHash — and still no good way to compare hashes
I download a file. The website has a SHA-256 hash next to it. I want to verify it. So I run sha256sum , get a wall of hex, paste the expected hash next to it, and squint at two 64-character strings trying to spot any difference. For a quick one-off verification, the native tools are clunky. On Linux it's sha256sum , on macOS it's shasum -a 256 , on Windows it's some PowerShell command. Different syntax, same manual effort. (Yes, sha256sum -c exists. But it expects a properly formatted checksum file — not a hash you just copied off a download page.) So I ended up building a small CLI for this: verify-integrity . What it does Instead of just outputting a string or failing quietly, it shows you a character-by-character diff so you can see exactly where they diverge: $ npx verify-integrity ./myfile.zip 3a4c9877b483ab46d7c3fbe165a0db275e1ae3cfe56a5657e5a47c2f99a99d1e ✖ Hashes did not match! Integrity verification failed. Expected: 3a4c9877b483ab46d7c3fbe165a0db275e1ae3cfe56a5657e5a47c2f99a9
Continue reading on Dev.to
Opens in a new tab



