Current location - Quotes Website - Signature design - What is a hash value?
What is a hash value?

Hash value, also known as: Hash function is a method of creating a small digital "fingerprint" from any kind of data.

The hash function compresses the message or data into a digest, making the amount of data smaller and fixing the format of the data. This function shuffles the data to recreate a fingerprint called a hash value.

The hash value is usually represented by a short string of random letters and numbers. Good hash functions rarely have hash collisions in the input domain. In hash tables and data processing, failure to suppress collisions to distinguish data can make database records harder to find.

Extended information:

Properties of hash values:

All hash functions have the following basic characteristics: If the two hash values ??are not the same (according to the same function), then the original inputs of the two hash values ??are also different.

This characteristic is the result of the deterministic nature of the hash function. A hash function with this property is called a one-way hash function. But on the other hand, the input and output of the hash function are not uniquely corresponding. If two hash values ??are the same, the two input values ??are likely to be the same.

But it may be different. This situation is called "hash collision (collision)", which is usually two input values ??of different lengths, deliberately calculating the same output value.

Input some data to calculate a hash value, and then partially change the input value. A hash function with strong obfuscation properties will produce a completely different hash value.

Typical hash functions have a very large domain of definition. For example, SHA-2 accepts a maximum length of (2-1)/8 byte strings. At the same time, the hash function must have a limited value range, such as a fixed-length bit string.

In some cases, the hash function can be designed to have the same size domain and injection between the ranges. Hash functions must be irreversible.

Baidu Encyclopedia-Hash value