jaguar_otp 0.1.0 copy "jaguar_otp: ^0.1.0" to clipboard
jaguar_otp: ^0.1.0 copied to clipboard

Dart 1 only

TOTP utilities for Dart and Jaguar.dart

jaguar_otp #

TOTP utilities for Dart and Jaguar.dart

Usage #

Generate secret #

generateSecret method on Totp generates a Base32 encoded secret for use with TOTP.

  // Generate secret for an account
  final String secret = Totp.generateSecret();
  print('secret');

Create TOTP Uri #

makeUri method on Totp creates TOTP Uri from individual components.

  // Create TOTP Uri
  String uri = Totp.makeUri('teja', 'tejainece@gmail.com', secret);
  print(uri);

Generate code #

  // Generate for present time
  print(Totp.generateCode(secret));

Generate Qr code for TOTP Uri #

  // Create TOTP Uri Qr code
  final qr = new Qr(uri);
  await qr.save('qr.png');
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

TOTP utilities for Dart and Jaguar.dart

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

base32, crypto, http

More

Packages that depend on jaguar_otp