wupz/

google-authenticator php 库

V1.0.1 2020-05-12 06:29 UTC

This package is auto-updated.

Last update: 2024-09-04 14:01:00 UTC


README

Google Authenticator PHP 库

  • 命令
$: composer require wupz/google-authenticator
  • 示例
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');