totp
totp(time-based one-time password)とは、unix時間からotpを作成するalgorithmです。例
Uint8Array.toTOTP.js
1. counterをunix時間を時間ステップで割って作成します。2. hmacをdecodeしたsecret keyとcounterから作成します。
3. hmacから最下位4ビットをindexとした4バイトの値を取得します。
4. 3から符号を外した最下位6桁を取得します。
2-4はhotp(hmac-based one-time password)と同じalgorithmです。