Generate Given Number of Random Bytes using PHP

random_bytes function

<?php

$n = 8;
$randomBytes = random_bytes($n);

print_r(unpack('C*', $randomBytes));

Leave a Comment

Cancel reply

Your email address will not be published.