Hash deep Learning

Source: Internet
Author: User

First, the definition

A hash is a hashing that transforms an arbitrary-length input into a fixed-length output (the output is a hash value) through a hashing algorithm. Simply, a function that compresses messages of any length to a message digest of a fixed length.

keyword k: input value

hash function h (key): a fixed algorithm to complete conversions

Hash Table (also known as a hash table): The result sheet after the keyword is output by a hash function

Second, the commonly used hash function

1. Direct addressing method: Take a keyword or a keyword of a linear function value is a hash address. That is, H (key) =key or H (key) = a key + B, where A and B are constants (this hash function is called its own function). If there is already a value in H (key), go to the next one, until there is no value in H (key), put it in. 2. Digital Analysis: Analysis of a set of data, such as the date of birth of a group of employees, we found that the number of days before the birth of the first few numbers are roughly the same, so that the probability of conflict will be very large, but we found that the number of days after the month and the date of the numbers vary greatly, If you use the following numbers to form a hash address, the odds of the conflict will be significantly reduced. Therefore, the digital analysis method is to find out the laws of numbers, as far as possible to use this data to construct a low probability of conflict hash address. 3. The square takes the middle method: takes the key word square after several as the hash address. 4. Folding method: The keyword is divided into several parts of the same number of bits, the last part of the number can be different, and then take these parts of the overlay and (remove carry) as the hash address. Digital superposition can have two methods: shift superposition and boundary superposition. The shift overlay aligns the lowest bits of each part of the split, then adds, and the bounding overlay is folded back and forth from one end to the other, and then the addition is aligned. 5. Random number method: Select a random function, take the random value of the keyword as a hash address, usually used for different keyword lengths. 6. In addition to the remainder method: Take the keyword is not greater than the hash table length m of the number of p after the remainder is a hash address. That is, H (key) = key MOD p,p<=m. Not only can the keyword directly modulo, but also in the collapse, the square to take the medium operation after the modulo. The choice of P is very important, generally take prime or m, if p is not good, easy to produce synonyms
7. Multiply rounding Method: F (x): =trunc ((x/maxx) *maxlongit) mod MAXM, mainly used for real numbers.
8.MD4: It is implemented on a 32-bit word processor with high-speed software-it is based on a bitwise operation of 32-bit operands.
9.MD5:MD5 is more complex than MD4 and slower, but more secure, and better in terms of resistance to analysis and differential resistance.
10.sha-1 and others Iii. methods of dealing with conflicts1. Open addressing method; Hi= (H (key) + di) MOD m,i=1,2,..., K (k<=m-1), where H (key) is a hash function, M is a hash table, and di is an incremental sequence, the following three methods can be used: 1). di=1,2,3,..., m-1, called linear detection re-hash; 2). Di=1^2, ( -1) ^2,2^2, ( -2) ^2, (3) ^2,..., ± (k) ^2, (K&LT;=M/2) called two probes and hashes; 3). di= pseudo random number sequence, called pseudo-random detection re-hash. 2. Re-hashing: Hi=rhi (key), i=1,2,..., K RHi are different hash functions, that is, when a synonym generates an address conflict, computes another hash function address, until the conflict no longer occurs, this method is not easy to generate "aggregation", but increase the calculation time. 3. Chain Address Method (Zipper method) 4. Create a public overflow zone

Hash deep Learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.