TOTP class

Constructors

TOTP({int digits = 6, HashAlgorithm hashAlgorithm = HashAlgorithm.sha1})

Properties

digits int
final
hashAlgorithm HashAlgorithm
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generateQRCodeUri(String appName, String secretKey, {String issuer = 'totp_authenticator', int interval = 30}) String
  • appName : App name
  • secretKey: Secret key
  • issuer: Issuer name, default: totp_authenticator
  • generateQRCodeUrl(String appName, String secretKey, {String issuer = 'totp_authenticator'}) String
    Returns a URL for ready QR Code
    generateTOTPCode(String secretKey, {int interval = 30, int? time}) String
    Generates an OTP code based on the provided secret and interval.
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    toString() String
    A string representation of this object.
    inherited
    verifyCode(String secretKey, String otpCode, {int interval = 30, int discrepancy = 1}) bool
    Verifies a given TOTP code against a secret key.

    Operators

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

    Static Methods

    generateSecret({int length = 16}) String
    The secret is generated using the Base32 alphabet and is suitable for use in TOTP (Time-based One-Time Password) applications.