random_bytes Generates cryptographically secure pseudo-random bytes &reftitle.description; stringrandom_bytes intlength Generates an arbitrary length string of cryptographic random bytes that are suitable for cryptographic use, such as when generating salts, keys or initialization vectors. &csprng.sources; &reftitle.parameters; length The length of the random string that should be returned in bytes. &reftitle.returnvalues; Returns a string containing the crypto-secure random bytes in binary format. &reftitle.errors; Issues an E_WARNING and returns &false; when a sufficient source of randomness is unavailable. &reftitle.examples; <function>random-bytes</function> example ]]> &example.outputs.similar; &reftitle.seealso; random_int openssl_random_pseudo_bytes bin2hex