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!)
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!
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)