PHPackages                             lfkeitel/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. lfkeitel/phptotp

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

lfkeitel/phptotp
================

TOTP/HOTP library for PHP

v1.1.0(4y ago)85434.7k↓16.8%15[1 issues](https://github.com/lfkeitel/php-totp/issues)2MITPHPPHP ^5.6 || ^7.0 || ^8.0

Since Feb 6Pushed 4y ago2 watchersCompare

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

READMEChangelog (1)DependenciesVersions (3)Used By (2)

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)

```
