14 lines
272 B
Python
14 lines
272 B
Python
import pyotp
|
|
|
|
def generateOTP(secret):
|
|
totp = pyotp.TOTP(secret)
|
|
code = totp.now()
|
|
print(code)
|
|
return code
|
|
|
|
# def checkOTP(secret, code):
|
|
# totp = pyotp.TOTP(secret)
|
|
# return totp.verify(code)
|
|
|
|
def generateSecret():
|
|
return pyotp.random_base32() |