HOTP constructor
HOTP(
- List<
int> secret, { - int digits = 6,
- required List<
int> counter, - BlockHashBase<
BlockHashSink> algo = sha1, - String? label,
- String? issuer,
Creates an instance of the HOTP class with the specified parameters.
Parameters:
secretis the shared secret as a list of bytes for generating the OTP.digitsis the number of digits in the generated OTP (default is 6).counteris the counter value used in the HOTP algorithm (required).algois the block hash algorithm to use (default is sha1).labelis an optional string to identify the account or service the OTP is associated with.issueris an optional string to specify the entity issuing the OTP.
Implementation
HOTP(
this.secret, {
int digits = 6,
required this.counter,
BlockHashBase algo = sha1,
String? label,
String? issuer,
}) : assert(digits <= 15),
algo = HMAC(algo).by(secret),
_max = _pow10[digits],
super(
digits,
label: label,
issuer: issuer,
);