diff --git a/reference/openssl/functions/openssl-random-pseudo-bytes.xml b/reference/openssl/functions/openssl-random-pseudo-bytes.xml index 8c1e25ac1f..9fbedbb472 100644 --- a/reference/openssl/functions/openssl-random-pseudo-bytes.xml +++ b/reference/openssl/functions/openssl-random-pseudo-bytes.xml @@ -3,7 +3,7 @@ openssl_random_pseudo_bytes - Generate a pseudo-random string + Generate a pseudo-random string of bytes @@ -11,12 +11,16 @@ stringopenssl_random_pseudo_bytes stringlength - stringstrong + boolcrypto_strong - openssl_random_pseudo_bytes returns a &string; with - length caracters. It also indicates if it has used - a strong algorithm to produce those pseudo-random bytes in the second argument. + Generates a string of pseudo-random bytes, with the number of bytes + determined by the length parameter. + + + It also indicates if a cryptographically strong algorithm was used to produce the + pseudo-random bytes, and does this via the optional crypto_strong + parameter. It's rare for this to be &false;, but some systems may be broken or old. @@ -28,17 +32,18 @@ length - The length of the desired string. Must be a positive integer. PHP will + The length of the desired string of bytes. Must be a positive integer. PHP will try to cast this parameter to a non-null integer to use it. - strong + crypto_strong - If a strong algorithm was used, or not, as a boolean. - This parameter will be &null; if an error occurrs. + If passed into the function, this will hold a boolean value that determines + if the algorithm used was "cryptographically strong", e.g., safe for usage with GPG, + passwords, etc. &true; if it did, otherwise &false; @@ -49,7 +54,7 @@ &reftitle.returnvalues; - Returns the generated &string; in case of success, &return.falseforfailure;. + Returns the generated &string; of bytes on success, &return.falseforfailure;. @@ -61,35 +66,60 @@ ]]> &example.outputs.similar; + + &reftitle.seealso; + + bin2hex + crypt + mt_rand + uniqid + +