<?php
// PHP 7 native functions
// functions implemented for PHP 5 in paragonie/random_compat
try {
$int = random_int(0, 128);
} catch (Error $e) {
echo $e->getMessage();
} catch (Exception $e) {
echo $e->getMessage();
}
dump($int);
try {
$string = random_bytes(32);
} catch (Error $e) {
echo $e->getMessage();
} catch (Exception $e) {
echo $e->getMessage();
}
dump(bin2hex($string));
^ 96
^ "2ec6dd83e6b427cc12b77e9cdbce4a628f93e8784a8803805514bcc881713c6b"