How is the hash function double hash calculated?

Updated on technology 2024-04-11
3 answers
  1. Anonymous users2024-02-07

    Keywords k1 ≠ k2, but h(k1) = h(k2). Uniform hash function.

    , different keyword values correspond to the same storage location.

    Start inserting 59, i=0, h(59,0)=(59 mod 11 + 0*(1+59 mod 9)) mod 11=4, position 4 conflicts with 37, continue to calculate.

    Conflict 1 time, i=1, h(59,1)=(59 mod 11 + 1*(1+59 mod 9)) mod 11=10, position 10 empty, 59 inserted into position 10.

    If there is a further conflict, then i=2, continue to calculate, and so on.

    25 and 72 are similar.

  2. Anonymous users2024-02-06

    Answer]: A packet digest algorithm (hash algorithm) is a carefully selected one-way function, through which a long message can be easily calculated to digest its packet, and the length of the generated packet digest is fixed, not affected by the length of the original packet.

    And it has the characteristics of unidirectional and unique at the same time, that is, it is impossible to get the original message from the digest in turn (unidirectional). The same message digest can only be generated if the same packet digest operation and the same original message are used.

    It is precisely because of these characteristics that the packet summary algorithm is often combined with the digital signature beam to realize the function of packet identification.

    RFC 1321 proposes the message summarization algorithm MD5 with rubber ridges, which has been widely used. It calculates packets of any length to produce a 128-bit MD5 packet digest**.

    Another common packet summarization algorithm is the secure hash algorithm, which is similar to MD5 but has a code length of 160 bits, which is more secure than MD5 but less efficient than MD5.

  3. Anonymous users2024-02-05

    1) Remainder method: The family scramble first estimates the number of table items in the entire hash table. This estimate is then used as a divisor to remove each original value to get the quotient and remainder.

    2) Folding method: This method is used when the original value is a number, the original value is divided into several parts, and then the parts are superimposed, and the last four digits obtained (or other digits of the number can be used) are used as the hash value.

    3) Cardinal conversion method: When the original value is a number, you can convert the cardinality of the original large value into a different number. For example, you can convert a decimal raw value to a hexadecimal hash. In order to make the hash value the same length, the high digit can be omitted.

    4) Data rearrangement method: This method simply shuffles the data in the original value. For example, you can reverse the numbers from the third to the sixth digits, and then use the rearranged numbers as the hash value.

    Hash functions are not universal, for example, using hash functions in databases that work well may not be feasible for cryptography or error checking. There are several well-known hash functions in the field of cryptography. These functions include MD2, MD4, and MD5, which use hashing to convert digital signatures into a hash called a message digest, as well as the Secure Hash Algorithm (SHA), a standard algorithm that generates larger (60-bit) summaries of information, somewhat similar to the MD4 algorithm.

Related questions
10 answers2024-04-11

If p is no longer on a straight line ab, then according to the three-point formula, a parabola must be determined, and now p is no longer on any parabola across ab. >>>More

9 answers2024-04-11

A hash table (also known as a hash table) is a data structure that is directly accessed based on the key value. That is, it accesses records by mapping key values to a location in the table to speed up lookups. This mapping function is called a hash function, and the array that holds the records is called a hash table. >>>More

8 answers2024-04-11

Because the even function must satisfy the requirement of f(-x) = f(x). >>>More

8 answers2024-04-11

Analysis] Inverse matrix definition: If the nth-order matrix a and b satisfy ab=ba=e, then a is said to be reversible, and the inverse matrix of a is b. >>>More