PHP中的Hash算法(3)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-20 18:32 点击:次
11. anyone. So I try an explanation: if one experimentally tests all
12. multipliers between 1 and 256 (as RSE did now) one detects that even
13. numbers are not useable at all. The remaining 128 odd numbers
14. (except for the number 1) work more or less all equally well. They
15. all distribute in an acceptable way and this way fill a hash table
16. with an average percent of approx. 86%.
17.
18. If one compares the Chi^2 values of the variants, the number 33 not
19. even has the best value. But the number 33 and a few other equally
20. good numbers like 17, 31, 63, 127 and 129 have nevertheless a great
21. advantage to the remaining numbers in the large set of possible
22. multipliers: their multiply operation can be replaced by a faster
23. operation based on just one shift plus either a single addition
24. or subtraction operation. And because a hash function has to both
25. distribute good _and_ has to be very fast to compute, those few
26. numbers should be preferred and seems to be the reason why Daniel J.
27. Bernstein also preferred it.
28.
29. www.2cto.com -- Ralf S. Engelschall <rse@engelschall.com>
• 作者: Laruence
• 本文地址: http://www.laruence.com/2009/07/23/994.html
相关新闻>>
- 发表评论
-
- 最新评论 更多>>