public static get_random_bytes ( integer $length ) : string | false | ||
$length | integer | Output length |
return | string | false | false on error |
public static function get_random_bytes($length)
{
if (!$length) {
return false;
}
$length = (int) $length;
if ($length <= 0) {
return false;
}
return random_bytes($length);
}