扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
Hash算怎么在PHP中使用?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
成都创新互联从2013年开始,先为高淳等服务建站,高淳等地企业,进行企业商务咨询服务。为高淳企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。php代码:
define('testtime', 50000); $algos = hash_algos(); foreach($algos as $algo) { $st = microtime(); for($i = 0; $i < testtime; $i++) { hash($algo, microtime().$i); } $et = microtime(); list($ss, $si) = explode(' ', $st); list($es, $ei) = explode(' ', $et); $time[$algo] = $ei + $es - $si - $ss; } asort($time, SORT_NUMERIC); echo ""; print_r($time); Array ( [crc32b] => 0.14577506593323 [crc32] => 0.14600901216125 [adler32] => 0.14769597711182 [md4] => 0.1584680151825 [md5] => 0.15956400747681 [salsa20] => 0.16176804933166 [salsa10] => 0.16325911569214 [tiger128,3] => 0.16543607070923 [sha1] => 0.16547892630005 [tiger160,3] => 0.16672711079407 [tiger192,3] => 0.16793211837769 [tiger128,4] => 0.16802901655579 [sha224] => 0.16959108877563 [tiger160,4] => 0.1713979150238 [tiger192,4] => 0.1717759589386 [sha256] => 0.17396298696899 [ripemd256] => 0.17431005943298 [ripemd128] => 0.17437094918823 [ripemd320] => 0.17870710316467 [haval160,3] => 0.18147005220032 [haval256,3] => 0.18150104528809 [haval224,3] => 0.18176211320496 [sha512] => 0.18234492471313 [haval192,3] => 0.18296506645203 [ripemd160] => 0.18318411643982 [haval128,3] => 0.18408892243958 [sha384] => 0.18502903718567 [haval128,4] => 0.18848111178589 [haval256,4] => 0.18875202952576 [haval160,4] => 0.1895639828186 [haval224,4] => 0.19041207319641 [haval192,4] => 0.19101205462646 [whirlpool] => 0.19728892146301 [haval256,5] => 0.19996902294922 [haval160,5] => 0.20026498704529 [haval192,5] => 0.20072503967285 [haval128,5] => 0.20132308227539 [haval224,5] => 0.2025869493103 [gost] => 0.24892493852234 [snefru256] => 0.28652299385071 [snefru] => 0.29043891609192 [md2] => 0.6300178873291 )
看完上述内容,你们掌握Hash算怎么在PHP中使用的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注创新互联行业资讯频道,感谢各位的阅读!
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流