2 ms·
This article contains errors. "Using multiplication requires a mechanism to transport changes from high bit positions to low bit positions. Bit reversal is bes
by mtdewcmu 13y ago
This article contains errors.
"Using multiplication requires a mechanism to transport changes from high bit positions to low bit positions. Bit reversal is best, but is slow to implement. A viable alternative is left shifts."
Left shifts transport bits from low to high, no?
Less trivially, the discussion of reversibility appears to be incorrect and irrelevant. The property that every key has a unique hash is too strong for a general purpose hash function. For a general purpose hash function, the space of hashes is assumed to be much smaller than the space of keys, so a 1:1 mapping is unattainable. The goal instead is to decorrelate collisions from the input key distribution, even when the key distribution isn't known in advance. The hashes should resemble random numbers, even when the set of inputs is highly skewed (which is almost always the case). Collisions should occur about as often as if the hashes had actually been random numbers. The random-appearing distribution of outputs, regardless of input distribution, is the property that defines a good general purpose hash.