What is the hash function and how does it relate to cryptocurrency?
Hash function is a one-way function, which means it is fairly easy to get the output from input but very difficult to get the input from output. The hash output is called hashed digest.
If one wants to calculate the input from a given output, one needs to use try and error method to search the input one character by one character. It could be very difficult if the searching space was set to be very large.
Bitcoin uses a very large search space as the mining method. Miner whoever finds out the input from a given output of a hashed function (which is in a very large searching space, means very difficult), gets the rewards or called “mined a block”.