Hash Lab

Ecosystem · Command line

Command-line hashers

Hash a file from the terminal in one command. The most-used utilities ship with the OS (sha256sum, md5sum on Linux; shasum on macOS); newer ones (b3sum) install from package managers. They all share one output format: DIGEST FILENAME.

The big six

CommandAlgorithmShips with
md5sumMD5GNU coreutils
sha1sumSHA-1GNU coreutils
sha224sum, sha256sum, sha384sum, sha512sumSHA-2 familyGNU coreutils
b2sumBLAKE2b/2sGNU coreutils
b3sumBLAKE3Separate package (BLAKE3 team)
shasumSHA-1 / SHA-2 / SHA-3 familymacOS, perl-based

Usage patterns

# Single file
sha256sum file.bin

# Generate a manifest
sha256sum *.tar.gz > SHA256SUMS

# Verify a published manifest
sha256sum --check SHA256SUMS

# With BLAKE3 (much faster on large files)
b3sum file.bin

# On macOS where sha256sum is missing
shasum -a 256 file.bin

# Pipe / stdin
curl -sL https://example.com/file.bin | sha256sum

Output format gotchas

Quirks per OS

BLAKE3’s b3sum

BLAKE3’s reference repository ships b3sum: faster than every coreutils hasher on large files, often by an order of magnitude, because of multi-core parallelism. The output format matches coreutils and is therefore drop-in compatible with b3sum --check MANIFEST.

Manifests in the wild

References