您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > PHP >

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
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • PHP测试
  • 十天学会php之第六天
  • 几种显示数据的方法的比较
  • 使用xmlhttp为网站增加域名查询功能
  • PHP+MYSQL+Javascript数据库查询结果的动态显示
  • 查找数组中指定键名的值
  • 用redis实现跨服务器session
  • 用新浪微博接口发送图片微博失败的原因
  • smarty局部缓存技术[源码分析]
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1