Hash
A hash is a digital fingerprint of data, such as text or a transaction. The same data always produces exactly the same hash value.
What is a hash?
A hash is usually a long string of letters and numbers with a fixed length. A hash function creates this string by processing data. This process is called hashing.
Changing even one letter in the data produces a completely different hash. You can’t recover the original data from a hash. That’s why hashes can be used to check whether information has been changed.
A simple hash example
Say a system processes the text Hello with a hash function such as SHA-256. This produces the following hash:
753692ec36adb4c794c973945eb2a99c1649703ea6f76bf259abb4fb838e013e
What if you change the text to Hello! by adding just an exclamation point? That produces a completely different hash:
357a57fe73d6c63bb1923e970f79a924db3a3609eb9797547784a94ee38fc3df
This shows that even a small change to the original data produces a completely different hash. That makes hashing useful for checking whether information has changed.
Why is a hash important in crypto?
A blockchain uses hashes to secure transactions and blocks. A block contains, among other things, a hash of the previous block. This links the blocks together.
If someone tries to change data in an earlier block, its hash changes too. The computers that check the blockchain can detect this. To hide the change, someone would also have to recalculate and validate every block that follows.
Hashes are also used in Proof of Work mining, such as with Bitcoin. Computers then try to solve a hash puzzle. News about hash rate or mining often refers to the computing power used for these calculations.