DEV Community

Sreekar Reddy
Sreekar Reddy

Posted on • Originally published at sreekarreddy.com

🔢 Hashing Explained Like You're 5

A fingerprint for data

Day 19 of 149

👉 Full deep-dive with code examples


The Fingerprint Analogy

Every person has a unique fingerprint.

From a fingerprint, you CAN:

  • ✅ Identify who someone is
  • ✅ Check if two prints match

From a fingerprint, you CANNOT:

  • ❌ Recreate the whole person!

Hashing creates a "fingerprint" for data.


How It Works

Put any data into a hash function:

"hello" → a591a6d40bf420404a011733cfb7b190
"Hello" → 8b1a9953c4611296a827abf8c47804d7
"hello " → (completely different!)
Enter fullscreen mode Exit fullscreen mode

Notice:

  • Same input → Same output (for the same hash function)
  • Tiny change → Completely different output
  • Can't reverse it!

Why Can't You Reverse It?

Hashing throws away information.

Imagine making a smoothie:

  • Apple + Banana + Milk → Smoothie

Can you separate the smoothie back into apple, banana, and milk?
No! The blending is one-way.

Hashing is the same. Data goes in, hash comes out, no going back.


Real Uses

Password Storage:

Password: "pizza123"
Stored: "5d41402abc4b2a..."

You type "pizza123" → Hashed → Matches stored hash? ✅ Login!
Enter fullscreen mode Exit fullscreen mode

Good websites store a hash of your password (not the password itself).

File Integrity:
Download says: Hash should be abc123...
Your file's hash: abc123... → ✅ File wasn't tampered with!


In One Sentence

Hashing turns data into a fingerprint-like value that can help verify matches but can't be reversed.


🔗 Enjoying these? Follow for daily ELI5 explanations!

Making complex tech concepts simple, one day at a time.

Top comments (0)