FileAccess Orion

GoogleAuthenticatorLib
in package
implements GoogleAuthenticatorInterface

Tags
see
https://github.com/google/google-authenticator/wiki/Key-Uri-Format

Interfaces, Classes, Traits and Enums

GoogleAuthenticatorInterface

Table of Contents

$codePeriod  : int
$instanceTime  : DateTimeInterface
$passCodeLength  : int
$periodSize  : int
$pinModulo  : int
$secretLength  : int
__construct()  : mixed
checkCode()  : bool
generateSecret()  : string
getCode()  : string
NEXT_MAJOR: add the interface typehint to $time and remove deprecation.
hashToInt()  : int

Properties

Methods

__construct()

public __construct([int $passCodeLength = 6 ][, int $secretLength = 10 ][, DateTimeInterface|null $instanceTime = null ][, int $codePeriod = 30 ]) : mixed
Parameters
$passCodeLength : int = 6
$secretLength : int = 10
$instanceTime : DateTimeInterface|null = null
$codePeriod : int = 30
Return values
mixed

checkCode()

public checkCode(string $secret, string $code[, int $discrepancy = 1 ]) : bool
Parameters
$secret : string
$code : string
$discrepancy : int = 1
Return values
bool

getCode()

NEXT_MAJOR: add the interface typehint to $time and remove deprecation.

public getCode(string $secret[, float|string|int|DateTimeInterface|null $time = null ]) : string
Parameters
$secret : string
$time : float|string|int|DateTimeInterface|null = null
Return values
string

hashToInt()

private hashToInt(string $bytes, int $start) : int
Parameters
$bytes : string
$start : int
Return values
int

Search results