PasswordHash::get_random_bytes
Method of the class: PasswordHash{}
No Hooks.
Returns
null. Nothing (null).
Usage
$PasswordHash = new PasswordHash(); $PasswordHash->get_random_bytes( $count );
- $count(required)
- .
PasswordHash::get_random_bytes() PasswordHash::get random bytes code WP 6.9.1
function get_random_bytes($count)
{
$output = '';
if (@is_readable('/dev/urandom') &&
($fh = @fopen('/dev/urandom', 'rb'))) {
$output = fread($fh, $count);
fclose($fh);
}
if (strlen($output) < $count) {
$output = '';
for ($i = 0; $i < $count; $i += 16) {
$this->random_state =
md5(microtime() . $this->random_state);
$output .= md5($this->random_state, TRUE);
}
$output = substr($output, 0, $count);
}
return $output;
}