MD5 and SHA-256 are cryptographic hash functions that turn any input into a fixed-length fingerprint. MD5 produces 128 bits and is fast but broken - practical collision attacks exist. SHA-256, part of the SHA-2 family, produces 256 bits and remains secure.
The right choice hinges on whether you need security or just a cheap checksum. MD5 still appears in non-security contexts like cache keys, but it must never protect anything an attacker could tamper with.
