check method
Chack a OTP code.
@param otp
The OTP code.
@param counter
The counter value.
@param digits
The OTP code length.
Implementation
bool check(
String otp, {
int counter = 0,
int breadth = 0,
}) {
for (int index = counter - breadth; index <= counter + breadth; index++) {
if (otp ==
make(
digits: otp.length,
counter: index,
)) {
return true;
}
}
return false;
}