$bytes = openssl_random_pseudo_bytes(32, $strong);
if ($strong !== true) {
throw new RuntimeException('No strong entropy source available.');
}
$token = bin2hex($bytes);
$bytes = openssl_random_pseudo_bytes(32, $strong);
if ($strong !== true) {
throw new RuntimeException('No strong entropy source available.');
}
$token = bin2hex($bytes);