low tech
11-09-2010, 06:00 AM
Hello all
confused
I am generating a temp password with this
$pwd = mt_rand(1000, 9999);
But I want to generate it with this function
how do I assign $pwd to use this function???
// Password and salt generation
function PwdHash($pwd, $salt = null)
{
if ($salt === null) {
$salt = substr(md5(uniqid(rand(), true)), 0, SALT_LENGTH);
}
else {
$salt = substr($salt, 0, SALT_LENGTH);
}
return $salt . sha1($pwd . $salt);
}
Help welcomed and much appreciated:-)
LT
confused
I am generating a temp password with this
$pwd = mt_rand(1000, 9999);
But I want to generate it with this function
how do I assign $pwd to use this function???
// Password and salt generation
function PwdHash($pwd, $salt = null)
{
if ($salt === null) {
$salt = substr(md5(uniqid(rand(), true)), 0, SALT_LENGTH);
}
else {
$salt = substr($salt, 0, SALT_LENGTH);
}
return $salt . sha1($pwd . $salt);
}
Help welcomed and much appreciated:-)
LT