PHPackages                             faj1/otp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. faj1/otp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

faj1/otp
========

对OTPHP的封装

1.0.4(1y ago)08MITPHP

Since Dec 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/faj1/otp)[ Packagist](https://packagist.org/packages/faj1/otp)[ RSS](/packages/faj1-otp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

本库是对 spomky-labs/otphp 库的简化封装 请使用以下命令进行安装,使用方法请参考测试用例

```
composer require faj1/otp

```

```
public function testVerify()
{
    var_dump(Otp::verify('KSWUWUM334TJFY5HRLQFFI6UTDDYWIXJP2YNQOJH6J4I2IKQ4OESH5HAMWDBL3VOC7LM55UBLUFWANFZR7ZSUQLH5VLHK3BM2DW2DGQ',696735));
    $this->assertTrue(true, 'Code executed successfully without exceptions.');
}

public function testGetImg()
{
    echo Otp::getImg('KSWUWUM334TJFY5HRLQFFI6UTDDYWIXJP2YNQOJH6J4I2IKQ4OESH5HAMWDBL3VOC7LM55UBLUFWANFZR7ZSUQLH5VLHK3BM2DW2DGQ').PHP_EOL;
    $this->assertTrue(true, 'Code executed successfully without exceptions.');
}

public function testGetSecret()
{
    echo Otp::getSecret().PHP_EOL;

    $this->assertTrue(true, 'Code executed successfully without exceptions.');
}

public function testGetOpt()
{
    echo Otp::getOpt('KSWUWUM334TJFY5HRLQFFI6UTDDYWIXJP2YNQOJH6J4I2IKQ4OESH5HAMWDBL3VOC7LM55UBLUFWANFZR7ZSUQLH5VLHK3BM2DW2DGQ').PHP_EOL;
    $this->assertTrue(true, 'Code executed successfully without exceptions.');
}

```

```

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

520d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0218fc896fe52e0d04873517c4b208ad1542deeaa0e51f98e3f42c80a83cf29?d=identicon)[faj1](/maintainers/faj1)

---

Top Contributors

[![githabus](https://avatars.githubusercontent.com/u/10916592?v=4)](https://github.com/githabus "githabus (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/faj1-otp/health.svg)

```
[![Health](https://phpackages.com/badges/faj1-otp/health.svg)](https://phpackages.com/packages/faj1-otp)
```

###  Alternatives

[lcobucci/clock

Yet another clock abstraction

796190.9M114](/packages/lcobucci-clock)[symfony/clock

Decouples applications from the system clock

431168.9M205](/packages/symfony-clock)[eventsauce/eventsauce

A pragmatic event sourcing library for PHP with a focus on developer experience.

8632.1M47](/packages/eventsauce-eventsauce)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.4k423.9k30](/packages/mcp-sdk)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
