PHP Класс OTPHP\TOTP

Наследование: extends OTP, implements otphp\TOTPInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $label, string | null $secret = null, integer $period = 30, string $digest = 'sha1', integer $digits = 6 ) TOTP constructor.
at ( $timestamp )
getPeriod ( )
getProvisioningUri ( )
now ( )
verify ( $otp, $timestamp = null, $window = null ) If no timestamp is provided, the OTP is verified at the actual timestamp {@inheritdoc}

Приватные методы

Метод Описание
getTimestamp ( integer | null $timestamp ) : integer
setPeriod ( integer $period ) : self
timecode ( integer $timestamp ) : integer
verifyOtpWithWindow ( string $otp, integer $timestamp, integer $window ) : boolean

Описание методов

__construct() публичный Метод

TOTP constructor.
public __construct ( string $label, string | null $secret = null, integer $period = 30, string $digest = 'sha1', integer $digits = 6 )
$label string
$secret string | null
$period integer
$digest string
$digits integer

at() публичный Метод

public at ( $timestamp )

getPeriod() публичный Метод

public getPeriod ( )

getProvisioningUri() публичный Метод

public getProvisioningUri ( )

now() публичный Метод

public now ( )

verify() публичный Метод

If no timestamp is provided, the OTP is verified at the actual timestamp {@inheritdoc}
public verify ( $otp, $timestamp = null, $window = null )