You are here

public static function SystemStatusEncryption::getToken in System Status 8

System Status: create a new token.

1 call to SystemStatusEncryption::getToken()
system_status_install in ./system_status.install
Implements hook_install().

File

src/Controller/SystemStatusEncryption.php, line 13
Encryption logic for system_status

Class

SystemStatusEncryption

Namespace

Drupal\system_status\Controller

Code

public static function getToken() {
  $chars = array_merge(range(0, 9), range('a', 'z'), range('A', 'Z'), range(0, 99));
  shuffle($chars);
  $token = "";
  for ($i = 0; $i < 8; $i++) {
    $token .= $chars[$i];
  }
  return $token;
}