PHPGangsta / GoogleAuthenticator

PHP class to generate and verify Google Authenticator 2-factor authentication
http://phpgangsta.de/4376
BSD 2-Clause "Simplified" License
2.26k stars 697 forks source link

Cleaned up Code #111

Open LandonMoss opened 10 months ago

LandonMoss commented 10 months ago

Extracted the random byte generation logic into a separate function (generateRandomBytes). Removed unnecessary variable initialization ($rnd = false;). Combined the openssl_random_pseudo_bytes check and assignment into one statement. Added a default case in the generateRandomBytes function to return false if no secure random function is available.