MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / verifyTotp

Method verifyTotp

CodenameOne/src/com/codename1/security/Otp.java:125–128  ·  view source on GitHub ↗
(byte[] secret, String code, int tolerance)

Source from the content-addressed store, hash-verified

123 /// side of `now` (so a tolerance of 1 will accept the previous, current
124 /// and next code).
125 public static boolean verifyTotp(byte[] secret, String code, int tolerance) {
126 return verifyTotp(secret, code, tolerance,
127 System.currentTimeMillis(), 30, 6, Hash.SHA1);
128 }
129
130 /// Builds the canonical `otpauth://totp/...` URI that authenticator apps
131 /// (Google Authenticator, Microsoft Authenticator, 1Password, Authy, ...)

Callers 3

runOtpVectorsMethod · 0.95
invokeStatic7Method · 0.80

Calls 4

currentTimeMillisMethod · 0.95
hotpMethod · 0.95
trimMethod · 0.65

Tested by 2

runOtpVectorsMethod · 0.76