Display the drop-down list

openssl_random_pseudo_bytes()

« openssl_public_encrypt | ord »
<?php
$string 
openssl_random_pseudo_bytes (
    
// int $length
    
  // [bool &$crypto_strong]
);

// shows the result in hexadecimal
if ($string) {
    
$hex bin2hex($string);
}
?>
Result
$crypto_strong = true
$string = '{'
$hex = '7b06f49b'
Examples
#1 openssl_random_pseudo_bytes  (4,
 
$crypto_strong)
#2 openssl_random_pseudo_bytes  (1,
 
$crypto_strong)
#3 openssl_random_pseudo_bytes  (0,
 
$crypto_strong)
#4 openssl_random_pseudo_bytes  (-1,
 
$crypto_strong)
See also
bin2hex, crypt, mt_rand, random_bytes, uniqid