function GoogleAuthenticator::createBase32Key in Google Authenticator login 6
Same name and namespace in other branches
- 7 ga4php.php \GoogleAuthenticator::createBase32Key()
2 calls to GoogleAuthenticator::createBase32Key()
File
- ./
ga4php.php, line 291
Class
Code
function createBase32Key() {
$alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
$key = "";
for ($i = 0; $i < 16; $i++) {
$offset = rand(0, strlen($alphabet) - 1);
//echo "$i off is $offset\n";
$key .= $alphabet[$offset];
}
return $key;
}