diff --git a/docs/index.html b/docs/index.html index 9e12c76..e166b39 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,10 +6,11 @@ - + + @@ -17,13 +18,19 @@ + - + + + + + + @@ -95,7 +102,7 @@

Usage

// Generate a Time-based OTP from the secret, using Unix-time // rounded down to the nearest 30 seconds. -String code = OTP.create(secret, OTP.timeInHex(), 6, "totp"); +String code = OTP.create(secret, OTP.timeInHex(), 6, Type.TOTP);

Show User QR Code1
Easiest way to do this is through Goolge APIs, but I plan to add a generateImage() function soon.

@@ -107,6 +114,8 @@

Usage



https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=200x200&chld=M|0&cht=qr&chl=otpauth://totp/Example:hello@example.com?secret=IM4ZL3G5Q66KW4U7PMOQVXQQH3NGOCHQ&issuer=Example&algorithm=SHA1&digits=6&period=30 +

+ (You can use OTP.getURL() to get the otpauth:// URL too.)

@@ -115,7 +124,7 @@

Usage

String userEnteredCode = "123456"; // Verify OTP -if(OTP.verify(secret, userEnteredCode, 6, "totp")) { +if(OTP.verify(secret, userEnteredCode, 6, Type.TOTP)) { // Code valid. Login successful. }