Hash function: Difference between revisions

Content deleted Content added
If the key value is 64-bit, and the sections are 15-bit, that means 4 15-bit sections plus one 4-bit section (15*4 + 4 = 64).
Line 133:
 
=== Folding ===
A folding hash code is produced by dividing the input into n sections of m bits, where 2<sup>m</sup> is the table size, and using a parity-preserving bitwise operation such as ADD or XOR to combine the sections, followed by a mask or shifts to trim off any excess bits at the high or low end. For example, for a table size of 15 bits and a 64-bit key value of 0x0123456789ABCDEF, there are fourfive sections consisting of 0x4DEF, 0x1357, 0x159E, 0x091A and 0x8. Adding, we obtain 0x7FFE0x7AA4, a 15-bit value.
 
=== Mid-squares ===