Now Let's See Hashing in Action
So far, you've learned what hashing is and how it works. Now it's time to bring it to life with some real examples.
Let's take a look at how the SHA-256 hash function—used by Bitcoin—works in practice.
Example 1: Original Input
Let's start with this sentence:
"IFCCI.com is cool as ice."
When we pass this through the SHA-256 hash function, we get the following hash (also called a "digest"):
A58E12FAC905B8F84EA2F64F888191A4B66A67CC45F8E7B7B0F94C37A134CB57
As you can see, the result is a 64-character combination of numbers and letters.
At first glance, it just looks like random gibberish. But that's the point! The hash tells you nothing about the original input—it's designed to conceal it.
And here's the cool part:
The same input will always produce the same hash.
Example 2: Small Change, Big Difference
Now, let's make a tiny change to the original sentence.
We'll change the word "ice" to "lice":
"IFCCI.com is cool as lice."
And here's the new hash:
B8784EAEB1FC50719B2041FB1AEE30FF91516529CCB65B4B446CC4D5F6B4EB95
Even though only one letter changed, the new hash is completely different from the original one.
| Input | Hash (SHA-256) |
|---|---|
| IFCCI.com is cool as ice. | A58E12FAC905B8F84EA2F64F888191A4B66A67CC45F8E7B7B0F94C37A134CB57 |
| IFCCI.com is cool as lice. | B8784EAEB1FC50719B2041FB1AEE30FF91516529CCB65B4B446CC4D5F6B4EB95 |
Example 3: Another Small Change
Let's swap "lice" for "rice":
"IFCCI.com is cool as rice."
The new hash:
FCA7032BE8CF7F3C0DD75B8DEB77412E452EA5E2275BAA4125123CD639ED2C9A
Once again, a tiny change leads to a completely different hash.
| Input | Hash (SHA-256) |
|---|---|
| IFCCI.com is cool as ice. | A58E12FAC905B8F84EA2F64F888191A4B66A67CC45F8E7B7B0F94C37A134CB57 |
| IFCCI.com is cool as lice. | B8784EAEB1FC50719B2041FB1AEE30FF91516529CCB65B4B446CC4D5F6B4EB95 |
| IFCCI.com is cool as rice. | FCA7032BE8CF7F3C0DD75B8DEB77412E452EA5E2275BAA4125123CD639ED2C9A |
Key Takeaways
- Hashing is sensitive: Even a minor change in input produces a totally different hash.
- Fixed output length: No matter the size of the input, the SHA-256 hash is always 64 characters long.
- Irreversible: You can't figure out the original message from the hash.
- Tamper detection: Any changes to input will be instantly detectable thanks to the changed hash.
This is why hashing is so useful in cryptocurrency. It helps detect tampering and ensures data integrity.
Try It Yourself!
Want to see hashing in action? Try using a SHA-256 hash generator online. Type in any message and see what hash you get. Then, make just a tiny change—add a letter, punctuation, or space—and watch how the entire hash changes.
Give it a try and see how powerful hashing really is!
