Skip to content
Back to Path
Module 2 of 8

Hash Functions

A hash function is a one-way mathematical algorithm that turns any amount of data into a unique, fixed-size string of characters. No matter how large the input, the output (the hash) is always the same length.

Analogy

"A digital smoothie. You can turn fruit into a smoothie, but you can't look at the smoothie and turn it back into the original fruit."

Key Properties

  • Deterministic: Same input always results in the same output.
  • Fixed-Size: A single letter or a whole book results in a fixed-length string.
  • Collision Resistant: It's nearly impossible for two different inputs to have the same hash.

Real World

Companies like Google and Facebook don't store your actual password. They store a 'Hash' of it. When you log in, they hash your entry and see if it matches the stored fingerprint.

Interactive Simulation

Live Environment

SHA-256 Hasher

#e2e8f0

This color is unique to your text. Change one letter, get a new color!

0 bits