Skip to content
Snippets Groups Projects
Unverified Commit d2d8fc93 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3118581 by kiamlaluno: The documentation for Crypt::randomBytesBase64()...

Issue #3118581 by kiamlaluno: The documentation for Crypt::randomBytesBase64() is wrong about the output length
parent 6aee1497
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,8 @@ public static function hashBase64($data) {
* The number of random bytes to fetch and base64 encode.
*
* @return string
* The base64 encoded result will have a length of up to 4 * $count.
* A base-64 encoded string, with + replaced with -, / with _ and any =
* padding characters removed.
*/
public static function randomBytesBase64($count = 32) {
return str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(random_bytes($count)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment