The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Does anyone know how to generate a salt?
By salt I mean the table value "salt" which is created randomly when a user is made, and is used to verify the credentials when a user is logging in. Example salt: ;3hTgCLfyOuw|8!A8_Lgjf3|68(IXp |
|
#2
|
|||
|
|||
|
This should work:
Code:
function createUserSalt()
{
$saltlength = 32;
$salt = '';
for ($i = 0; $i < $saltlength; $i++)
{
$salt .= chr(rand(33, 126));
}
return $salt;
}
|
![]() |
|
|