public static Crypt::randomBytesBase64($count = 32)
Returns a URL-safe, base64 encoded string of highly randomized bytes.
$count: The number of random bytes to fetch and base64 encode.
string The base64 encoded result will have a length of up to 4 * $count.
\Drupal\Component\Utility\Crypt::randomBytes()
public static function randomBytesBase64($count = 32) { return str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(static::randomBytes($count))); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!Crypt.php/function/Crypt::randomBytesBase64/8.1.x