note 104232 modified in function.sha1 by danbrown
| From: | danbrown@php.net | Date: | Thu, 02 Jun 2011 17:58:22 +0000 |
| Subject: | note 104232 modified in function.sha1 by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180204@lists.php.net to get a copy of this message | ||
SSHA LDAP password generation algorithm for standard PHP > 5.0
public function hashSSHA($password)
{
$salt = sha1(rand());
$salt = substr($salt, 0, 4);
$hash = base64_encode( sha1($password . $salt, true) . $salt );
return $hash;
}
?>
--was--
SSHA LDAP password generation algorithm for standard PHP > 5.0
public function hashSSHA($password)
{
$salt = sha1(rand());
$salt = substr($salt, 0, 4);
$hash = base64_encode( sha1($password . $salt, true) . $salt );
return $hash;
}
http://php.net/manual/en/function.sha1.php