Skip to content

Core\Totp

One-time codes for two-factor login (TOTP, RFC 6238). These are the six-digit codes that an authenticator app on a phone shows, and a new one starts every 30 seconds. code returns the current code for a secret, and check tests a code that a user typed.

Members

2 members.

MemberSignature
codecode(secret bytes $secret): string
checkcheck(string $code, secret bytes $secret, int $after = 0): ?int