-
-
Notifications
You must be signed in to change notification settings - Fork 134
Upgrading to v3
Gerald Yeo edited this page Aug 20, 2019
·
1 revision
Google Authenticator
-
otplib.google.[METHOD]
->otplib.authenticator.[METHOD]
-
otplib.google.secret()
->otplib.authenticator.generateSecret()
HOTP
-
otplib.core.hotp()
->otplib.hotp.generate()
-
otplib.core.checkHOTP()
->otplib.hotp.check()
TOTP
-
otplib.core.totp()
->otplib.totp.generate()
-
otplib.core.checkTOTP()
->otplib.totp.check()
Helpers
-
otplib.core.helpers.[METHOD]
->otplib.[hotp|totp].utils.[METHOD]
Secret
-
otplib.core.secret.generate()
->otplib.[hotp|totp].utils.generateSecret()
-
otplib.core.secret.removeSpaces()
->otplib.[hotp|totp].utils.removeSpaces()
-
otplib.core.secret.divideIntoSetsOf()
->otplib.[hotp|totp].utils.setsOf()
If you want specific functionality, you may do
var totp = require('otplib/lib/totp')
instead of
var otplib = require('otplib');
var totp = otplib.totp;
In order to ease migration, you may use the v2 API compatible library.
var otplib = require('otplib/v2');