Definition
What it is
A hash function takes bytes of any length and returns a string of fixed length: 256 bits (32 bytes) for SHA-256, 128 bits (16 bytes) for MD5, 160 bits for SHA-1. The mapping is deterministic and one-way. You cannot reconstruct the input from the digest, but you can verify that a given input produces a given digest.
Cryptographic digests are distinct from "checksums" in the loose sense. A CRC32 catches transmission errors; a SHA-256 digest resists deliberate collision attacks. Use CRC for storage media, SHA-256 for security-critical integrity.
Why it matters
Every HTTPS certificate, every Git commit, every container image, every signed JWT relies on a digest. When you pull nginx@sha256:abc..., you are trusting a digest — not a version tag, not a filename. The digest is the only thing an attacker cannot forge without breaking cryptography.
Cryptographic vs non-cryptographic
Algorithm | Output bits | Status | Use |
|---|---|---|---|
CRC32 | 32 | Checksum only | Storage, network frames |
MD5 | 128 | Broken (collisions) | Non-security only |
SHA-1 | 160 | Deprecated (SHAttered, 2017) | Legacy only |
SHA-256 | 256 | Current standard | TLS, Git, containers, signatures |
SHA-3 | variable | Current alternative | Post-quantum prep |
Where digests appear
graph LR F[Input bytes] --> H[Hash function] H --> D[Digest 256-bit] D --> I[Integrity check] D --> S[Digital signature] D --> A[Content address] D --> C[Cache key] style D fill:#E8F5E9
How to use digests well
Digests that hold
Never compare with `==` in security code
Use constant-time comparison (
hash_equalsin PHP,hmac.compare_digestin Python) to avoid timing side-channels.Pin by digest, not tag
Container images, tarballs and packages should reference
name@sha256:..., notname:latest.Prefer SHA-256
MD5 and SHA-1 have known collision attacks. Never use them for security, signatures or integrity.
Record the digest in the manifest
Every artifact should carry its digest in the manifest so deploys can verify.
Common failures
Origin
The word "digest" comes from Latin digestus, past participle of digerere ("to divide, to distribute"). In 1979 Ralph Merkle used it for hash functions and hash trees (Merkle trees). The NIST series (FIPS 180, then 180-4) standardized SHA-1 and SHA-2 in 1993–2015. SHA-3 followed in 2015 as a backup.
A cryptographic hash function is a mathematical algorithm that maps data of arbitrary size to a bit array of a fixed size.
— NIST FIPS 180-4, 2015 (paraphrase)
Evidence
FAQ
- Hash vs digest?
Same thing. "Digest" emphasizes the output; "hash" emphasizes the function.
- Can a digest be reversed?
No, by design. Brute-force on weak inputs is possible; use strong hashing plus salt for passwords.
- Is SHA-256 quantum-safe?
Not fully, but Grover's algorithm halves its effective strength to 128 bits, still acceptable in 2026.
- MD5 vs SHA-256?
MD5 is faster and broken; SHA-256 is fast enough and collision-resistant.
Connections
- sha
- hash
- hmac
- signature
- container-image
NIST (2015). FIPS 180-4. https://csrc.nist.gov/publications/detail/fips/180/4/final
RFC 6234 (2011). US Secure Hash Algorithms. https://www.rfc-editor.org/rfc/rfc6234
Stevens, M. et al. (2017). SHAttered. https://shattered.io/
Etymology
Origin: borrowed
digest(noun): from Latin digestus, "divided, ordered"
Semantic network
● broader ● narrower ● related
Used in the garden
- The DBA-Free Playbook: Unlocking MySQL's Hidden Power for Your SaaS (1×)
- The Forgotten Secret Connecting Your Breath to Eternal Youth and Calm (1×)
- Email Marketing for Brand and SEO: The Channel That Builds Loyalty and Traffic (1×)
- Unlocking Market Dominance: Build a Hyper-Niche Price Comparison Engine (1×)
- Unlock Success! 10 FREE Web Apps Your Competitors DON'T Want You To Know About (Smart Entrepreneur Edition) (1×)
- Unlock Google's Visual Secrets: A Practical Guide to Rich Snippets for Niche E-commerce (1×)
- Newsletter SEO: How to Turn Emails into SEO Traffic (1×)
- Crafting the 'Wow' Factor: Aesthetic MVPs for Lean B2B SaaS in Spain (1×)
- The Breath That Changes Everything: Science of Pranayama (1×)
- Master Linux Automation: Bash Scripting Secrets for Solo IT Founders (1×)
- The K Blueprint (1×)
- Algorithmic Arbitrage: Capitalizing on B2B Marketplace Inefficiencies (1×)
- The Secret 'Hack' No One Tells You for an Extraordinary Life (and it's right under your nose) (1×)
Sources
NIST (2015). FIPS 180-4. https://csrc.nist.gov/publications/detail/fips/180/4/final
RFC 6234 (2011). https://www.rfc-editor.org/rfc/rfc6234