This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 15k traffic Daily!!!

What is a hash function?


What’s a hash operate?

A hash operate or algorithm transforms an quantity of knowledge (which might be arbitrarily giant) right into a fixed-length hash. Let’s take a dummy hash operate referred to as “H” that takes an “x” parameter. H(“love”) may very well be equal to 250961 and H(“roma”) equal to 970845. Each outcomes have the identical variety of digits (six), nonetheless they’re remarkably completely different and we can’t see a correlation between the 2 values obtained , even utilizing the identical letters in a special order.

This operate is named unidirectional, since from “love” we arrive at 250961 with a predictable computational value, however it’s fairly troublesome to do the alternative course of (discover out the knowledge that has been hashed). An instance of a operate whose inverse course of is simple to carry out could be a operate S that takes an integer and provides 25 to it; we all know that, given an integer x, if the output of the operate S is 35, it’s as a result of the enter was the quantity 10.

An instance of a one-way operate entails multiplying arbitrarily giant prime numbers. Multiplying, for instance, 12,637 by 223, we get 2,818,051, that is trivial. Now attempt to discover the 2 prime numbers such that when multiplied collectively they yield 1956803. Extraordinarily troublesome, and it’s this downside that makes operations with prime numbers the premise for RSA encryption.

See, for instance, the sentence beneath, with 18 characters (areas are additionally characters):

I like Vaultree

Submitting it to SHA-256 (you are able to do the identical in some on-line converter), we’ll get the next end result:

C36e8b9d0b1d406070c04a755df7c10ad8bd3ea9ab0470f30feb306d408d00db

Word that the textual output is 64 characters lengthy and is principally a quantity. Nonetheless, it’s represented not with our decimal system, however with hexadecimal (generally used within the area of Pc Science), which incorporates the digits from 0 to 9 and the letters from A to F, totaling 16 symbols — therefore the identify.

This identical quantity might be represented in binary or decimal base:

Binary

1100111101011010101111000000000100101001100001000010100111000010000010110100011101101111001100110100011010011001010111000101100010001010111111101001111100110110010101110010011111111010101001000111011100000010001100011111000101011000000011100000111010101011

Decimal

9.378907345221151 * 10⁷⁶

The hash we obtained is nothing greater than a huge quantity displayed in hexadecimal format to characterize the phrase “I like Vaultree”. Now suppose we forgot to incorporate some letter or phrase and we need to do it now.

I like Vaultree’s SDK

This variation, which in our eyes is so delicate, causes massive adjustments within the hash that’s generated, look:

Previous hash:

C36e8b9d0b1d406070c04a755df7c10ad8bd3ea9ab0470f30feb306d408d00db

New hash:

A136f1bf0c29682db0a86bf871b9f4f8eb6bf3869ab1f0d8fae036ce47c87839

It’s value mentioning that the size stays the identical, as anticipated, however the contents have little resemblance to one another. One other attribute of the operate used to generate the hash is that it’s deterministic, which suggests that it’s going to produce the identical end result at any time when the identical enter is used.

The Article was Inspired from tech community site.
Contact us if this is inspired from your article and we will give you credit for it for serving the community.

This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 10k Tech related traffic daily !!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to Contribute to us or want to have 15k+ Audience read your Article ? Or Just want to make a strong Backlink?