TOTP class

The RFC 6238 algorithm implementation.

@see https://tools.ietf.org/html/rfc6238

Example 1:

final hoto = HOTP(secret);
final totp = TOTP(
   hoto,
   digits: 6,
   period: 30,
);
final value = totp.make();

Example 2:

final totp = TOTP.secret(
  secret,
  digits: 6,
  period: 30,
);
final value = totp.make();

Constructors

TOTP(HOTP hotp, {int digits = 6, int period = 30})
Create a new TOTP instance.
const
TOTP.secret(List<int> secret, {int digits = 6, int period = 30})
Create a new TOTP instance for a given secret.
factory

Properties

digits int
digits - The number of digits in the code.
final
hashCode int
The hash code for this object.
no setterinherited
hotp HOTP
The REC 4226 algorithm implementation.
final
period int
period - The number of seconds in the time period.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

check(String otp, [int breadth = 0]) bool
Chack a OTP value.
make() String
Make a OTP value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited