totp 0.0.1 copy "totp: ^0.0.1" to clipboard
totp: ^0.0.1 copied to clipboard

An implementation of the Time-based One-time Password (TOTP).

Time-based One-Time Password (TOTP) #

This is an implementation of the TOTP algorithm as specified in RFC 6238.

pub version

Installation #

Add the following to your pubspec.yaml:

dependencies:
  totp: latest

Or install it from the command line:

dart pub add totp

Usage #

import 'package:totp/totp.dart';

final totp = Totp(secret: '12345678901234567890'.codeUnits);

print(totp.now());

If you want to use a base32 encoded secret, you can use the fromBase32 constructor:

final totp = Totp.fromBase32(
  secret: 'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ',
);

APIs #

Method Return type Description
generate String Generates a new password with a DateTime
now String Generates a new password with DateTime.now()
validate bool Validates a password with a DateTime

License #

The project is licensed under the MIT license.

4
likes
140
pub points
82%
popularity

Publisher

verified publisherodroe.com

An implementation of the Time-based One-time Password (TOTP).

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

hotp

More

Packages that depend on totp