static function handler::generateRandom in OAuth2 Login 8
File
- src/
handler.php, line 10
Class
Namespace
Drupal\oauth2_loginCode
static function generateRandom($length = 30) {
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}