PHPackages                             donweb/phptotp - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. donweb/phptotp

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

donweb/phptotp
==============

TOTP/HOTP library for PHP

v1.0.1(4y ago)0112MITPHPPHP ^5.6 || ^7.0 || ^8.0

Since Feb 6Pushed 4y agoCompare

[ Source](https://github.com/DonWeb/php-totp)[ Packagist](https://packagist.org/packages/donweb/phptotp)[ RSS](/packages/donweb-phptotp/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (4)Used By (0)

HOTP/TOTP Token Generator
=========================

[](#hotptotp-token-generator)

This is a simple PHP library and script that will generate HOTP and TOTP tokens. The library fully conforms to RFCs 4226 and 6238. All hashing algorithms are supported as well as the length of a token and the start time for TOTP.

Installation
------------

[](#installation)

Add the following to your composer.json:

```
{
    "require": {
        "lfkeitel/phptotp": "^1.0"
    }
}

```

And run `composer install`.

Usage
-----

[](#usage)

```
