Quiz Entry - updated: 2026.07.14
What is a hash function in general, and what does it produce?
A function that maps an arbitrary-length input to a fixed-length output, called the hash value or fingerprint.
The structure:
arbitrary-length message → [ hash function ] → fixed-length hash value
(e.g. 10 GB file) e.g. SHA-256 256 bits / 32 bytes
Two big families:
| Family | Examples | Purpose |
|---|---|---|
| Non-cryptographic hashes | CRC32, FNV, MurmurHash, xxHash | Hash tables, checksums, error detection |
| Cryptographic hashes | SHA-256, SHA-3, BLAKE2/3 | Integrity, signatures, password hashing |
Both produce a fixed-size output, but the security properties differ — non-cryptographic hashes are fast but trivially collidable on purpose; cryptographic hashes must resist collisions.
Properties common to all hash functions:
- Deterministic — same input → same output, always.
- Fixed output size — regardless of input length.
- Fast — even cryptographic hashes are designed to be fast (GB/s).
Use cases for cryptographic hashes:
- File integrity (
sha256sumto verify a download). - Digital signatures (sign the hash, not the multi-GB document).
- Password storage (hash + salt, see Argon2).
- Blockchain proof-of-work and Merkle trees.
- Deduplication (S3, git uses SHA-1 as object IDs).
Tip: Git uses SHA-1 as object identifiers even though SHA-1 is "broken" for collision-resistance — git assumes a non-adversarial environment. For new systems use SHA-256 or SHA-3.