Essential Hash Tools for Developers
โ Back to Blog
Essential Hash Tools for Developers
ยท 5 min read
Built-in OS Command-Line Tools
The fastest hash tools are often already in your operating system:
# Linux (GNU coreutils)
md5sum file.iso # MD5
sha1sum file.iso # SHA1
sha256sum file.iso # SHA256
sha512sum file.iso # SHA512
b2sum file.iso # BLAKE2b (modern)
# macOS
md5 file.iso
shasum -a 256 file.iso
openssl dgst -sha256 file.iso
# Windows PowerShell
Get-FileHash file.iso -Algorithm MD5
Get-FileHash file.iso -Algorithm SHA256
Get-FileHash file.iso -Algorithm SHA512
# Windows cmd
certutil -hashfile file.iso MD5
certutil -hashfile file.iso SHA256
OpenSSL: The All-Purpose Cryptographic Tool
OpenSSL is a cryptographic Swiss Army knife available on almost all platforms, supporting nearly all common hash algorithms:
# Hash a file
openssl dgst -md5 file.iso
openssl dgst -sha1 file.iso
openssl dgst -sha256 file.iso
openssl dgst -sha512 file.iso
# Hash a string
echo -n "hello" | openssl dgst -sha256
# Generate HMAC
echo -n "message" | openssl dgst -sha256 -hmac "secret-key"
# List all supported algorithms
openssl list -digest-algorithms
Built-in Hash Libraries in Programming Languages
Major programming languages provide built-in hash functionality without additional dependencies:
// JavaScript / Node.js (crypto module - built-in)
const crypto = require('crypto');
crypto.createHash('md5').update(data).digest('hex');
crypto.createHash('sha256').update(data).digest('hex');
crypto.createHmac('sha256', key).update(data).digest('hex');
# Python (hashlib - built-in)
import hashlib
hashlib.md5(data).hexdigest()
hashlib.sha256(data).hexdigest()
hashlib.sha512(data).hexdigest()
import hmac; hmac.new(key, data, hashlib.sha256).hexdigest()
# Go (crypto/* - built-in)
import "crypto/md5"; import "crypto/sha256"
fmt.Sprintf("%x", md5.Sum(data))
fmt.Sprintf("%x", sha256.Sum256(data))
# PHP (built-in functions)
md5($string);
sha1($string);
hash('sha256', $string);
hash_hmac('sha256', $data, $key);
rhash: Multi-Algorithm Batch Hash Tool
rhash is an open-source command-line tool that can calculate multiple algorithm hashes in one pass โ ideal for scenarios requiring multiple checksum types simultaneously:
# Install: apt install rhash / brew install rhash
rhash --md5 --sha256 --sha512 file.iso
# Output all three in one command
# Generate checksums for release files
rhash --md5 --sha256 *.zip > SHA256SUMS
# Verify
rhash --check SHA256SUMS
hashdeep: Recursive Directory Hash Tool
hashdeep is specialized for hashing entire directory trees, generating or verifying hash manifests for all files in a directory โ commonly used in digital forensics and filesystem integrity monitoring:
# Generate MD5 hash for all files in directory
md5deep -r /path/to/directory > hashes.txt
# Audit mode: check which files have changed
md5deep -ra hashes.txt /path/to/directory
# Output: files that match, don't match, or are new
Verifying Build Artifacts in CI/CD
Verifying build artifacts in CI/CD pipelines is an important security practice (supply chain security):
# GitHub Actions example
- name: Generate checksums
run: |
sha256sum dist/*.tar.gz > SHA256SUMS
sha256sum dist/*.zip >> SHA256SUMS
- name: Verify checksums in subsequent jobs
run: |
sha256sum --check SHA256SUMS
# Docker image verification
docker pull myimage:v1.0
docker inspect myimage:v1.0 --format=''
# Compare with published digest
Criteria for Choosing Online Hash Tools
When choosing an online hash tool, these features matter: client-side computation (runs in browser, data not sent to server), support for multiple algorithms (at minimum MD5, SHA1, SHA256, SHA512), support for file hashing (not just text), fast loading, clean interface, and one-click copy. Our tool meets all these requirements and is completely free.
Python Hash Utility Script
#!/usr/bin/env python3
# hash_file.py - Calculate multiple hash algorithms for a file
import hashlib, sys
def hash_file(filepath):
algorithms = {
'MD5': hashlib.md5(),
'SHA1': hashlib.sha1(),
'SHA256': hashlib.sha256(),
'SHA512': hashlib.sha512(),
}
with open(filepath, 'rb') as f:
while chunk := f.read(65536):
for h in algorithms.values():
h.update(chunk)
for name, h in algorithms.items():
print(f"{name:8} {h.hexdigest()}")
if __name__ == '__main__':
hash_file(sys.argv[1])
Try the online tool now โ no installation, completely free.
Open Tool โ
Try the free tool now
Use Free Tool โ