Home > Today’s Crypto News
bitcoin
bitcoin

$78296.150408 USD

-6.06%

ethereum
ethereum

$1566.911665 USD

-13.25%

tether
tether

$1.000018 USD

0.04%

xrp
xrp

$1.876916 USD

-12.03%

bnb
bnb

$557.614617 USD

-5.62%

usd-coin
usd-coin

$1.000611 USD

0.06%

solana
solana

$105.570282 USD

-12.12%

dogecoin
dogecoin

$0.145710 USD

-13.19%

tron
tron

$0.227049 USD

-3.81%

cardano
cardano

$0.568870 USD

-12.00%

unus-sed-leo
unus-sed-leo

$8.917500 USD

-2.44%

chainlink
chainlink

$11.183946 USD

-12.41%

toncoin
toncoin

$2.932062 USD

-9.33%

stellar
stellar

$0.221191 USD

-12.20%

avalanche
avalanche

$16.013904 USD

-7.98%

Cryptographic Hash Function

What Is a Cryptographic Hash Function?

A cryptographic hash function is an algorithm, i.e. a repeatable sequence of specific actions, that can be used to transform an arbitrary data string of a variable length into one of a fixed length and format, called the hash.

One of the simplest examples of a hash function is adding up the digits in a number until one is left with a single-digit output. If the input is 49, for example, then adding 4 and 9 yields 13, whose digits 1 and 3 are then summed up again to give the output of 4. Regardless of the length of the input number, the output will always be a single digit.

That is not a good algorithm, however, because, in order to perform its functions well, a hash function needs to possess several characteristics:

  • It should be easy to compute an output for any given input, but nearly impossible to reverse the process and calculate the input of a known output;
  • Determinism — feeding a specific input into the algorithm should always produce the same output;
  • Collision resistance — two different inputs should be very unlikely to produce the same output;
  • Avalanche effect — changing even a single bit of data in the input should result in a wildly different output.

Hash functions are applied in many use cases, for example, as checksums to verify the integrity of computer files after their transmission of prolonged storage, or in randomizing functions.

They are also a key component in the mining of proof-of-work cryptocurrencies, such as Bitcoin (BTC), which uses the SHA-256 hash function. In order to add a new block to the blockchain and claim their reward of newly-mined Bitcoin, miners first need to produce a hash value that is below a certain threshold, called the target.

The fact that hashes are pseudorandom and it is impossible to predict an output of any input before actually running it through the hash function ensures that miners cannot print new Bitcoins out of thin air and need to prove the work they have performed.