Home » » openssl_random_pseudo_bytes

openssl_random_pseudo_bytes

Written By 1 on Tuesday, October 2, 2012 | 10:21 AM

string openssl_random_pseudo_bytes ( int $length [, bool &$crypto_strong ] )
Generate a pseudo-random string of bytes
Generates a string of pseudo-random bytes, with the number of bytes determined by the length parameter.


for ($i = -1; $i <= 4; $i++) {
$bytes = openssl_random_pseudo_bytes($i, $cstrong);
$hex = bin2hex($bytes);
echo "Lengths: Bytes: $i and Hex: " . strlen($hex) . PHP_EOL;
var_dump($hex);
var_dump($cstrong);
echo PHP_EOL;
}

0 Comment:

Post a Comment