Свойство | Type | Description | |
---|---|---|---|
$_codeLength |
Méthode | Description | |
---|---|---|
createSecret ( integer $secretLength = 16 ) : string | Create new secret. | |
getCode ( string $secret, integer | null $timeSlice = null ) : string | Calculate the code, with given secret and point in time. | |
getQRCodeGoogleUrl ( string $name, string $secret, string $title = null, array $params = [] ) : string | Get QR-Code URL for image, from google charts. | |
setCodeLength ( integer $length ) : PHPGangsta_GoogleAuthenticator | Set the code length, should be >=6. | |
verifyCode ( string $secret, string $code, integer $discrepancy = 1, integer | null $currentTimeSlice = null ) : boolean | Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now. |
Méthode | Description | |
---|---|---|
_base32Decode ( $secret ) : boolean | string | Helper class to decode base32. | |
_getBase32LookupTable ( ) : array | Get array with all 32 characters for decoding from/encoding to base32. |
Méthode | Description | |
---|---|---|
timingSafeEquals ( string $safeString, string $userString ) : boolean | A timing safe equals comparison more info here: http://blog.ircmaxell.com/2014/11/its-all-about-time.html. |
protected _base32Decode ( $secret ) : boolean | string | ||
$secret | ||
Résultat | boolean | string |
protected _getBase32LookupTable ( ) : array | ||
Résultat | array |
public createSecret ( integer $secretLength = 16 ) : string | ||
$secretLength | integer | |
Résultat | string |
public setCodeLength ( integer $length ) : PHPGangsta_GoogleAuthenticator | ||
$length | integer | |
Résultat | PHPGangsta_GoogleAuthenticator |
public verifyCode ( string $secret, string $code, integer $discrepancy = 1, integer | null $currentTimeSlice = null ) : boolean | ||
$secret | string | |
$code | string | |
$discrepancy | integer | This is the allowed time drift in 30 second units (8 means 4 minutes before or after) |
$currentTimeSlice | integer | null | time slice if we want use other that time() |
Résultat | boolean |