Afficher la liste déroulante

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);
}
?>
Résultat
$crypto_strong = true
$string = 'p<'
$hex = '703c9fa3'
Exemples
#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)
Voir aussi
bin2hex, crypt, mt_rand, random_bytes, uniqid