Jump to content

Random Password


brown2005

Recommended Posts

Hi is this the best function for a Random Password or is there a better one...

function makeRandomPassword()
{

$salt = "abchefghjkmnpqrstuvwxyz0123456789";

srand((double)microtime()*1000000); 

$i = 0;

while ($i <= 7)
{
 
$num = rand() % 33;

$tmp = substr($salt, $num, 1);

$pass = $pass . $tmp;

$i++;

}

$pass = md5($pass);
     
return $pass;
     
}
Link to comment
https://forums.phpfreaks.com/topic/22881-random-password/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.