# Hash Function: Encrypt and Decrypt Online

A hash function in cryptography refers to a mathematical function that converts a numerical input value into another compressed numerical value. The input to the hash function is of arbitrary length but the output is always of fixed length.

A hash function is also known as a hashing algorithm or message digest function.

To put it simply, a hash function takes a group of characters and maps it to a value of certain length.

That is to say, for any x input value, you will always get the same y output value whenever the hash function runs.

f(x) = y

This means every input has a predetermined output. The hash value represents the original string of characters but it is usually smaller than the original. The value you get after processing a set of data through a hash function is called a hash value or message digest.

Note that the input can be any data like numbers, files and other types of files. The process of transforming a given set of data to a specific hash value is called hashing the data. The hash value or message digest is always in form of a hexadecimal number.

Since the resulting value after hashing is much smaller compared to the data that passed through the function, makes hash functions to act like compression functions.