note 101846 added to function.crypt
| From: | daniel dot macdonald at designory dot com | Date: | Fri, 14 Jan 2011 01:19:02 +0000 |
| Subject: | note 101846 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175729@lists.php.net to get a copy of this message | ||
In PHP 5.3.1, I am running into trouble with crypt() and numeric strings:
code:
$salt = '$1$abcdefgh$';
$pass = "123";
$pass2 = "123a";
echo crypt($pass, $salt)."<br />\n";
echo crypt($pass, $salt)."<br />\n";
echo crypt($pass2, $salt)."<br />\n";
echo crypt($pass2, $salt)."<br />\n";
output:
$1$abcdefgh$OTo2MhKVLtpE9bkEycLQf0
$1$abcdefgh$JwVLNLvq4bwIKuyv1qm8L0
$1$abcdefgh$PiPnB9KJsYjPIXtoia0WK/
$1$abcdefgh$PiPnB9KJsYjPIXtoia0WK/
the results of the alphanumeric string are expected, but the numeric only string returns a different
result each time crypt() is called. I am at a loss.
----
Server IP: 69.147.83.197
Probable Submitter: 12.146.200.2
----
Manual Page -- http://www.php.net/manual/en/function.crypt.php
Edit -- https://master.php.net/note/edit/101846
Del: integrated -- https://master.php.net/note/delete/101846/integrated
Del: useless -- https://master.php.net/note/delete/101846/useless
Del: bad code -- https://master.php.net/note/delete/101846/bad+code
Del: spam -- https://master.php.net/note/delete/101846/spam
Del: non-english -- https://master.php.net/note/delete/101846/non-english
Del: in docs -- https://master.php.net/note/delete/101846/in+docs
Del: other reasons-- https://master.php.net/note/delete/101846
Reject -- https://master.php.net/note/reject/101846
Search -- https://master.php.net/manage/user-notes.php