shiwildy/phptotp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shiwildy/phptotp

最新稳定版本:1.0

Composer 安装命令:

composer require shiwildy/phptotp

包简介

A simple TOTP library for PHP.

README 文档

README

A simple TOTP library for PHP

Installation

composer require shiwildy/phptotp

Example

<?php

    require "vendor/autoload.php";
    use ShiWildy\phptotp;

    // Setup phptotp instance
    $phptotp = new phptotp();
    
    // Generate Secret Key
    $secret = $phptotp->getSecret();
    echo "Secret Key: " . $secret . PHP_EOL;
    
    // Generate Current auth code
    $auth = $phptotp->getAuth($secret);
    echo  "Current Auth Code:" . $auth . PHP_EOL;
    
    // Verify Auth code with secret key
    $verify = $phptotp->verify($auth, $secret);
    if ($verify === true) {
        echo "Verify status: Correct" . PHP_EOL;
    } else {
        echo "Verify status: Incorrect" . PHP_EOL;
    }
    
    // Generate TOTP Link
    $qrcodelink = $phptotp->getQRCodeUrl("ismy@email.com", "MyApp", $secret);
    echo "Importable Link for QR: "  . $qrcodelink . PHP_EOL;
?>

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.

License

This project licensed under The MIT License

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固