note 102806 deleted from function.md5 by danbrown
| From: | danbrown@php.net | Date: | Mon, 07 Mar 2011 21:24:56 +0000 |
| Subject: | note 102806 deleted from function.md5 by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-177639@lists.php.net to get a copy of this message | ||
Note Submitter: mimic
----
<?php
/*
* Absolutely safe MD5.
* Uses all the characters (small and large letters,
* numbers and symbols).
*
* powered by mimic | am0k.cz
*/
function umd5($in)
{
$db = '';
$field = preg_split('//', $in);
foreach ($field as $key => $row)
{
if (!$key || $key > strlen($in)) continue;
if ($key == 1) $db.= '[Beg1n]-> {';
$db.= 'i:'.floor(ord($row) * pi());
if ($key == strlen($in)) $db.= '} <- [End]';
}
return md5($db);
}
echo 'Ultra: '.umd5('password');
echo '<br>';
echo 'Normal: '.md5('password');
?>