totptool/cmds/gen.nim

21 lines
360 B
Nim

import base32
import nuuid
import otp
import random
import strutils
var res = generateUUID().replace("-")[0 .. 19]
try:
discard newTOTP(encode res).now()
except:
quit "it failed"
echo encode res
echo """" RATE_LIMIT 3 30 1441950209
" WINDOW_SIZE 3
" DISALLOW_REUSE 48065007
" TOTP_AUTH"""
for i in countup(0, 4, 1):
echo randomInt(10000000, 99999999)