Browsing all articles tagged with sha1
8
6

忘记md5(),sha1()等加密方法吧..

Author Jessica     Category PHP     Tags , , ,

这篇文章又严重的不严谨性.这个结果在现在看来是无效的.

大家就当看看儿戏吧..我就不删除了.

详情请查看hash()为什么比md5()要快?(已过时)

很多人都不知道PHP有个函数叫做hash() 也能实现md5等加密.

我们来试试它的速度如何.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   hash('md5', 'string');
echo microtime(1)-$time,': hash/md5';
 
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   md5('string');
echo microtime(1)-$time,': md5';
 
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   hash('sha1', 'string');
echo microtime(1)-$time,': hash/sha1';
 
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   sha1('string');
echo microtime(1)-$time,': sha1';
 
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   hash('md5', $i);
echo microtime(1)-$time,': hash/md5';
 
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   md5($i);
echo microtime(1)-$time,': md5';
 
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   hash('sha1', $i);
echo microtime(1)-$time,': hash/sha1';
 
$time=microtime(1);
for ($i=0;$i<100000;$i++)
   sha1($i);
echo microtime(1)-$time,': sha1';

read more

分类目录

最近文章

最近评论

文章索引模板

标签

.net AJAX button Comet CSS Discuz! DIV+CSS Flash Form Google HTML编辑器 IE8 Java JavaScript jQuery JSP md5 MySQLReback Oracle PHP php-fpm PNG Punny SkiyoTabs tab TagCloud Vista Web2.0 Windows7 上传 加密 变量 图标 本站原创 模板 模板引擎 源码 登录 短网址 石家庄 算法 编译 面向对象 魔术方法

链接表