GlossaryIntermediate
Hash Function
A mathematical process that turns any input into a fixed-length string of characters.
A hash function takes any amount of input data and produces a fixed-length output, called a hash, that looks like a random string of characters. The same input always produces the same hash, but even a tiny change to the input produces a completely different one.
Blockchains use hash functions to link blocks together and to make tampering with past data easy to detect, since changing even one character of the original data would change its hash entirely.
Examples
- Each block typically includes the hash of the previous block, linking them into a chain.
- Hashing a file lets someone verify later that the file hasn't been altered, by comparing hashes.