What is a Hash? A hash function is the backbone of Blockchain technology. All the blocks in Blockchain are connected via Hashes. So, What is a Hash Function?
A Hash function takes an input of any length and converts it into an output of a fixed length of 32 bytes. For e.g. if you will pass ‘Codies Alert’ to SHA256 Hash Function, it will give us the 32 bytes long Hash.
Another cool feature of the Hash function is that it is a deterministic function. This means, it will always produce the same Hash of given input and that’s why they are used everywhere in Blockchain from Transaction creation to validation.
Bitcoin and many other blockchains use the SHA256 Hash function. SHA256 is a set of cryptographic hash functions designed by the United States National Security Agency (NSA) and first published in 2001.
A hash is not ‘encryption’ – it cannot be decrypted back to the original text, it is a ‘one-way’ cryptographic function, and is a fixed size for any size of the source text. For example, you cannot get the original text ‘Codies Alert’ from below Hash. ‘91e0ff80fcc8a58bde2d1f7ce4e22db4d0b688f406bb1155b420608954b85379′.
SHA256 is one of the best Hashing algorithm out there when it comes to security. Hash functions are very useful when you need to detect if there is any change. For example, Github uses the Hash function to determine if anything has changed in a file.
If hope got an understanding of what is a Hash function. Share this article with your friends if you think it will be useful to them.