From 18c40e4e33785f53ddf09423af7b7bdc2827b29c Mon Sep 17 00:00:00 2001 From: Rob Janssen Date: Mon, 16 Mar 2015 18:46:35 +0100 Subject: [PATCH] Clarified comment a bit --- RobThree/TwoFactorAuth/TwoFactorAuth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RobThree/TwoFactorAuth/TwoFactorAuth.php b/RobThree/TwoFactorAuth/TwoFactorAuth.php index a825d46..c321698 100644 --- a/RobThree/TwoFactorAuth/TwoFactorAuth.php +++ b/RobThree/TwoFactorAuth/TwoFactorAuth.php @@ -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; } -} \ No newline at end of file +}