简体   繁体   中英

How to check if entered TOTP secret key format is correct?

I'm doing a small web project to generate OTP online (like Google authenticator). I'm currently using otpauth library to generate OTP code. It can't generate code if secret key is wrong. So how do I check if entered secret key is correct?

it is nothing more than a base32 string, and there are many libraries that can check that. example: How to check if a string is base32 encoded in javascript

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM