HOTP class

The RFC 4226 implentation of HOTP algorithm.

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

Example

final hotp = HOTP(secret);
final otpValue = hotp.make(
  counter: 0,
  digits: 6,
);

Constructors

HOTP(List<int> secret)
Create a HOTP instance.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
hmac → Hmac
Get using HMAC SHA1 algorithm for secret.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secret List<int>
The HOTP use HMAC-SHA1 secret.
final

Methods

check(String otp, {int counter = 0, int breadth = 0}) bool
Chack a OTP code.
make({int counter = 0, int digits = 6}) String
Make a OTP code.
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