diff --git a/reference/random/functions/random-bytes.xml b/reference/random/functions/random-bytes.xml index 003e48a57ff0..3a953c8917ec 100644 --- a/reference/random/functions/random-bytes.xml +++ b/reference/random/functions/random-bytes.xml @@ -13,7 +13,7 @@ intlength - Generates a string containing uniformly selected random bytes with the requested length. + Generates a string containing uniformly selected random bytes with the requested length. As the returned bytes are selected completely randomly, the resulting string is likely diff --git a/reference/random/random/randomizer/getbytes.xml b/reference/random/random/randomizer/getbytes.xml index e63ed1ca2c22..b8f0880a9544 100644 --- a/reference/random/random/randomizer/getbytes.xml +++ b/reference/random/random/randomizer/getbytes.xml @@ -12,7 +12,7 @@ intlength - Generates a string containing uniformly selected random bytes with the requested length. + Generates a string containing uniformly selected random bytes with the requested length. As the returned bytes are selected completely randomly, the resulting string is likely @@ -28,7 +28,7 @@ length - The length of the random string that should be returned in bytes; must be 1 or greater. + The length of the random &string; that should be returned in bytes; must be 1 or greater. @@ -38,7 +38,7 @@ &reftitle.returnvalues; - A string containing the requested number of random bytes. + A &string; containing the requested number of random bytes. diff --git a/reference/random/random/randomizer/getbytesfromstring.xml b/reference/random/random/randomizer/getbytesfromstring.xml index 743ea8c036cb..2f51dd1c0146 100644 --- a/reference/random/random/randomizer/getbytesfromstring.xml +++ b/reference/random/random/randomizer/getbytesfromstring.xml @@ -13,11 +13,14 @@ intlength - + Generates a string containing uniformly selected random bytes from the + input string with the requested length. + + + The chance for a byte to be selected is proportional to its share + of the input string. If each byte occurs + the same amount of times, each byte is equally likely to be selected. - - &warn.undocumented.func; - @@ -28,7 +31,7 @@ string - The string from which the returned bytes are selected. + The &string; from which the returned bytes are selected. @@ -36,7 +39,7 @@ length - The length of the random string that should be returned in bytes; must be 1 or greater. + The length of the random &string; that should be returned in bytes; must be 1 or greater. @@ -47,7 +50,7 @@ &reftitle.returnvalues; - Description + A &string; containing the requested number of random bytes taken from the input string. @@ -72,22 +75,45 @@ &reftitle.examples; - + <methodname>Random\Randomizer::getBytesFromString</methodname> example - - Description. - getBytesFromString('abcdefghijklmnopqrstuvwxyz0123456789', 16) +); +?> +]]> + + &example.outputs.similar; + + + + + + + Generate a random code for multi-factor authentication + +getBytesFromString('0123456789', 20), 5)); ?> ]]> - &example.outputs; + &example.outputs.similar;