wupz / google-authenticator
google-authenticator php library
V1.0.1
2020-05-12 06:29 UTC
This package is auto-updated.
Last update: 2024-10-04 14:10:22 UTC
README
Google Authenticator PHP Library
- command
$: composer require wupz/google-authenticator
- example
include 'path/vendor/autoload.php'; $gc = new WUWEIIT\GoogleAuthenticator(); echo 'secret:' . $secret = $gc->createSecret(16) . PHP_EOL; echo 'code:' . $gc->getCode($secret) . PHP_EOL; echo 'qrurl:' . $gc->getQRCodeGoogleUrl('吴强强', $secret, $title = 'wuweiit', $params = array()) . PHP_EOL; echo 'status:' . $gc->verifyCode('H2SJBBV2SXI4KDFP', '481410');