public static function Google2FA::getTimestamp in Google Authenticator login 7
Returns the current ts devided by the KEYREGENERATION period.
Return value
int Timestamp
2 calls to Google2FA::getTimestamp()
- ga_login_test_generate_code in tests/
ga_login_test/ ga_login_test.module - Generate the code for a given secret.
- Google2FA::verifyKey in tests/
ga_login_test/ ga_login_test.module - Verifys a key against the current timestamp.
File
- tests/
ga_login_test/ ga_login_test.module, line 113 - ga_login_test module.
Class
- Google2FA
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Code
public static function getTimestamp() {
return floor(microtime(TRUE) / self::KEYREGENERATION);
}