Hash Functions Made Simple: MD5 vs SHA-1 vs SHA-256 and How to Use Them
Download checksums, Git commit IDs and blockchain addresses are all hash values. This guide explains how hashing differs from encryption and which algorithm to choose for each job.
A hash function takes input of any length and produces a short value of fixed length, called a hash or digest. Whether you hash one word or a multi-gigabyte video, SHA-256 always outputs 256 bits, or 64 hexadecimal characters.
SHA-256("hello") = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
SHA-256("hello!") = ce06092fb948d9ffac7d1a376e404b26b7575bcc11ee05a4615fef4fec3a308b
MD5("hello") = 5d41402abc4b2a76b9719d911017c592
The three properties of a good hash, why MD5 and SHA-1 are retired for security, and how to use hashes for file integrity and password storage.Read guide →