q****x 发帖数: 7404 | 1 anyone know the answer of the following?
CLRS v3:
As Exercise 11.3-3 asks you to show, choosing m = 2^p - 1 when k is a
character string interpreted in radix 2p may be a poor choice, because
permuting the characters of k does not change its hash value.
11.3-3
Consider a version of the division method in which h(k) = k mod m, where
m = 2^p - 1 and k is a character string interpreted in radix 2^p. Show
that if we can derive string x from string y by permuting its characters,
then x and y hash to the same value. Give an example of an application in
which this property would be undesirable in a hash function. |
|