mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-21 16:11:48 +00:00
Clarified comment a bit
This commit is contained in:
@@ -50,7 +50,7 @@ class TwoFactorAuth
|
||||
public function createSecret($bits = 80)
|
||||
{
|
||||
$secret = '';
|
||||
$bytes = ceil($bits / 5); //We use 5 bits of each byte
|
||||
$bytes = ceil($bits / 5); //We use 5 bits of each byte (since we have a 32-character 'alphabet' / BASE32)
|
||||
$rnd = openssl_random_pseudo_bytes($bytes);
|
||||
for ($i = 0; $i < $bytes; $i++)
|
||||
$secret .= self::$_base32[ord($rnd[$i]) & 31]; //Mask out left 3 bits for 0-31 values
|
||||
@@ -144,4 +144,4 @@ class TwoFactorAuth
|
||||
|
||||
return $o;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user