PasswordHash::get_random_bytes()publicWP 1.0

Метод класса: PasswordHash{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$PasswordHash = new PasswordHash();
$PasswordHash->get_random_bytes( $count );
$count (обязательный)
-

Код PasswordHash::get_random_bytes() WP 6.5.2

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;
}