WireRandom::base64()
Generate a truly random base64 string of a certain length
This is largely taken from Anthony Ferrara's password_compat library: https://github.com/ircmaxell/password_compat/blob/master/lib/password.php Modified for camelCase, variable names, and function-based context by Ryan.
Usage
// basic usage
$string = $wireRandom->base64();
// usage with all arguments
$string = $wireRandom->base64(int $requiredLength = 22, $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
$requiredLength (optional) | int | Length of string you want returned Default:22 |
$options (optional) | array bool | Specify array of options or boolean to specify only
|
Return value
string
array
Returns only array if you specify array for $test argument, otherwise returns string
WireRandom methods and properties
API reference based on ProcessWire core version 3.0.251