First Commit

This commit is contained in:
Tyler
2026-03-24 17:01:09 -04:00
committed by GitHub
commit 71861ae630
15 changed files with 2047 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
"""TOTP code generation using pyotp."""
import pyotp
def generate_totp(secret: str) -> str:
"""Generate the current TOTP code from a base32 secret."""
totp = pyotp.TOTP(secret)
return totp.now()
def verify_totp(secret: str, code: str) -> bool:
"""Verify a TOTP code against a secret (useful for debugging setup)."""
totp = pyotp.TOTP(secret)
return totp.verify(code)