File Hasher
Quickly compute and verify file hashes. Supports MD5, SHA-1, and SHA-256.
Prerequisites
sha256sum,sha1sum,md5sumavailable on PATH (standard on Linux/macOS)
Usage
Compute a single hash
bash scripts/hash.sh <file> [algorithm]
algorithm:sha256(default),sha1, ormd5
Compute all algorithms at once
bash scripts/hash-all.sh <file>
Verify a hash
bash scripts/verify.sh <file> <expected-hash> [algorithm]
Exit code 0 = match, 1 = mismatch.
Examples
# SHA-256 of a file
bash scripts/hash.sh ./photo.jpg sha256
# All hashes
bash scripts/hash-all.sh ./document.pdf
# Verify MD5
bash scripts/verify.sh ./data.zip abc123def456 md5
