note 47886 added to function.md5
| From: | JohnS dot at osu1 dot php dot net | Date: | Fri, 03 Dec 2004 19:42:15 +0000 |
| Subject: | note 47886 added to function.md5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81339@lists.php.net to get a copy of this message | ||
If you want to replicate CPAN Crypt::MD5's function md5_base64 in PHP, use this code:
<?php
function md5_base64 ( $data )
{
return
preg_replace('/=+$/','',base64_encode(pack('H*',md5($data))));
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.md5.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47886
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47886&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47886&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47886&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47886&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47886&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47886&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47886&report=yes
Search -- http://master.php.net/manage/user-notes.php