I am generating random string with this:
$characters = '0123456789QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm';
$cl = strlen($characters) -1;
$id = '';
for ($p = 0; $p < $le; $p++) {N
$id .= $characters[mt_rand(0, $cl)];
}
Now, if I do str_shuffle($id)will it add entropy i.e. make the string more random?
If you want password entropy, might I suggest openssl_random_pseudo_bytes($length) or mcrypt_create_iv($length)?
For a custom character set, look up binhex() and convBase() which should be in the PHP manual comments for base_convert()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With