note 86186 modified in function.hash by danbrown
| From: | danbrown@php.net | Date: | Sat, 14 Mar 2009 14:46:30 +0000 |
| Subject: | note 86186 modified in function.hash by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151890@lists.php.net to get a copy of this message | ||
Comparison between hash algorithms.
<?php
$algos = hash_algos();
$word="hola";
foreach($algos as $algo)
{
echo $algo.": ";
$time=microtime(1);
echo hash($algo, $word);
echo "<br>".(microtime(1)-$time)."<br><hr>";
}
?>
unless you set your server up specially, you have to use
<?php and not <? at the beginning, or the code will spit out as html without any php
processed. so make note of that.
--was--
Comparison between hash algorithms.
<?
$algos = hash_algos();
$word="hola";
foreach($algos as $algo)
{
echo $algo.": ";
$time=microtime(1);
echo hash($algo, $word);
echo "<br>".(microtime(1)-$time)."<br><hr>";
}
?>
unless you set your server up specially, you have to use
<?php and not <? at the beginning, or the code will spit out as html without any php
processed. so make note of that.
http://php.net/manual/en/function.hash.php