Blockchain Basics: What is a Hash?

Blockchain Basics: What is a Hash?

What is a hash?

A hash is a map of data that is created through a cryptographic hash function. The hash function takes data of any arbitrary size and distills if to a fixed length or 32 or 64 bytes, depending on what hash function is being used. At Factom we use the SHA-256 Cryptographic Hash Algorithm that was developed by the United States National Security Agency (NSA).

Example

Take this well-known phrase, “Four score and seven years ago,” from President Lincoln's Gettysburg Address. When you input this data with a hash function, the output is a 32 or 64 predetermined set of characters.

Input: “Four score and seven years ago,”
Output: 911cef25974aad081643d0ec9b86f5c8e13b82ff64b63858f3e00e82dedee87f

If you changed the phrase to “4 score and 7 years ago,” the output is a completely different set of characters.

Input: “4 score and 7 years ago,”
Output: fd1b38fee251f8ed7647614dfea0f05ccb6202753f8834e278fd13a0be48da0d

As you can see the two hashes do not match because the data that makes up the phrase is different.