smartotp 3.1.4
smartotp: ^3.1.4 copied to clipboard
RFC6238 Time-Based One-Time Password / Google Authenticator Library
smartotp.sdk.flutter #
Getting started #
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? Use the template at the bottom!
Add your files #
- ❌ Create or upload files
- ❌ Add files using the command line or push an existing Git repository with the following command:
cd existing_repo
git remote add origin https://gitlab.com/mytel3/smartotp.sdk.flutter.git
git branch -M main
git push -uf origin main
eg #
import 'package:otp/otp.dart';
void main() {
String secret = "MZXW6YTBOI======";
// Generate TOTP code with SHA1
int totpCode = OTP.generateTOTPCode(secret, DateTime.now().millisecondsSinceEpoch);
print("Generated TOTP: $totpCode");
// Generate HOTP code with a counter
int counter = 7;
int hotpCode = OTP.generateHOTPCode(secret, counter);
print("Generated HOTP: $hotpCode");
}