note 84143 added to function.hash-algos
| From: | elinor dot hurst at gmail dot REMOVEME dot com | Date: | Mon, 30 Jun 2008 20:52:43 +0000 |
| Subject: | note 84143 added to function.hash-algos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141019@lists.php.net to get a copy of this message | ||
static function crypt_pass($pass, $salt=NULL)
{
$salt_len=7;
$algo='sha256';
if (!$salt||strlen($salt)<$salt_len)
{
$salt=uniqid(rand(), TRUE); // get unique string (length==23)
}
$salt=substr($salt, 0, $salt_len);
if (function_exists('hash') && in_array($algo, hash_algos()))
{
$hashed=hash($algo, $salt.$pass);
}
else
{
$hashed=sha1($salt.$pass);
}
return $salt.$hashed;
}
----
Server IP: 69.147.83.197
Probable Submitter: 213.49.72.246
----
Manual Page -- http://www.php.net/manual/en/function.hash-algos.php
Edit -- https://master.php.net/note/edit/84143
Del: integrated -- https://master.php.net/note/delete/84143/integrated
Del: useless -- https://master.php.net/note/delete/84143/useless
Del: bad code -- https://master.php.net/note/delete/84143/bad+code
Del: spam -- https://master.php.net/note/delete/84143/spam
Del: non-english -- https://master.php.net/note/delete/84143/non-english
Del: in docs -- https://master.php.net/note/delete/84143/in+docs
Del: other reasons-- https://master.php.net/note/delete/84143
Reject -- https://master.php.net/note/reject/84143
Search -- https://master.php.net/manage/user-notes.php