You may create one random string or strong random password by using the following php class at will.
/**
* Description of RandomString
*
* @package
*/
class RandomString
{
/**
*
* @param int $length
* @return string
*/
static public function getRandom($length)
{
$randomData = base64_encode(file_get_contents('/dev/urandom', false, null, 0, $length) . uniqid(mt_rand(), true));
return substr(strtr($randomData, array('/' => '', '=' => '', '+' => '')), 0, $length);
}
}
No comments:
Post a Comment