note 31238 added to function.md5
| From: | Shane at rack1 dot php dot net | Date: | Tue, 15 Apr 2003 01:53:14 +0000 |
| Subject: | note 31238 added to function.md5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46618@lists.php.net to get a copy of this message | ||
From the documentation on Digest::MD5:
md5($data,...)
This function will concatenate all arguments, calculate the MD5 digest of this "message",
and return it in binary form.
md5_hex($data,...)
Same as md5(), but will return the digest in hexadecimal form.
PHP's function returns the digest in hexadecimal form, so my guess is that you're using
md5() instead of md5_hex(). I have verified that md5_hex() generates the same string as PHP's
md5() function.
(original comment snipped in various places)
>Hexidecimal hashes generated with Perl's Digest::MD5 module WILL
>NOT equal hashes generated with php's md5() function if the input
>text contains any non-alphanumeric characters.
>
>$phphash = md5('pa$$');
>echo "php original hash from text: $phphash";
>echo "md5 hash from perl: " . $myrow['password'];
>
>outputs:
>
>php original hash from text: 0aed5d740d7fab4201e885019a36eace
>hash from perl: c18c9c57cb3658a50de06491a70b75cd
--
http://www.php.net/manual/en/function.md5.php
http://master.php.net/manage/user-notes.php?action=edit+31238
http://master.php.net/manage/user-notes.php?action=delete+31238
http://master.php.net/manage/user-notes.php?action=reject+31238