TOTP class

A Time-based One-Time Password (TOTP) algorithm implementation derived from rfc6238.

Inheritance

Constructors

TOTP.new(List<int> secret, {int digits = 6, String? label, String? issuer, Duration period = const Duration(seconds: 30), BlockHashBase<BlockHashSink> algo = sha1})
Creates an instance of the TOTP class with the specified parameters.

Properties

algo MACHashBase<HashDigestSink>
The underlying MAC algorithm
finalinherited
counter List<int>
The counter value
finalinherited
currentTime int
The current time in milliseconds since EPOCH with adjusted delta shift
no setter
digits int
The number of digits in the generated OTP
finalinherited
hashCode int
The hash code for this object.
no setterinherited
issuer String?
finalinherited
label String?
finalinherited
name String
The algorithm name
no setterinherited
period Duration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secret List<int>
The secret key
finalinherited
stream Stream<int>
A broadcast stream that reports new OTP value on every period interval
no setter
streamString Stream<String>
A broadcast stream that reports new OTP value as string on every period interval
no setter

Methods

adjustClock(int delta) → void
Adjust the internal clock with the parameter delta - the difference in milliseconds between the actual clock and the current system clock.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
value() int
Generates the next OTP value
override
valueString() String
Returns the next OTP value as string
inherited

Operators

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