What it is
A hash function turns input of any size into a fixed-length digest; cryptographic hashes like SHA-256 are designed so that tiny input changes produce completely different output.
When to use it
Developers hash values to verify file integrity, generate cache keys, compute checksums for downloads, or sign requests with HMAC when a shared secret is available.
Gotchas & limits
MD5 and SHA-1 are broken for security purposes (collision attacks exist) and should only be used for legacy compatibility or non-adversarial checksums, never for passwords or signatures.