Registry / auth-security / mintotp

mintotp

JSON →
library0.3.0pypypi✓ verified 85d ago

Minimal TOTP (Time-based One-Time Password) generator library. Current version 0.3.0. No known release cadence; last updated 2021.

pip install mintotp
INSTALL
IMPORT
SIG · MINTOTP
M
mintotp
auth-securitypythonv0.3.0
Install
1.5s avg
Import
10ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.010s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.008s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mintotp
import mintotp
from mintotp import ...
mintotp is a module containing functions; direct import works.

Generate and verify TOTP codes using a base32 secret.

import mintotp import time # Generate a TOTP using a secret (base32 encoded) secret = "JBSWY3DPEHPK3PXP" totp = mintotp.totp(secret) print(totp) # Verify a code code = input("Enter code: ") current_time = int(time.time()) print(mintotp.totp(secret, current_time) == code)
Debug
Known issues
gotchaThe secret must be base32 encoded (uppercase letters A-Z and digits 2-7). Providing a raw string will produce incorrect codes.
fix
Use a base32 encoder like `base64.b32encode(key_bytes)` to convert your secret.
affects: all
gotchaThe default time step is 30 seconds. Ensure clock synchronization. The function expects Unix timestamps in seconds.
fix
Use `int(time.time())` for current time. If using a different step, pass as third argument.
affects: all
Errors
Common errors & fixes
ValueError: Incompatible secret length
The secret string length is not a multiple of 8 (base32 padding requirement).
fix
Ensure the secret has proper base32 padding (e.g., add '=' characters if needed).
AttributeError: module 'mintotp' has no attribute 'generate'
Trying to call a non-existent function. mintotp only provides `totp()` and `hotp()`.
fix
Use `mintotp.totp(secret)` instead of `mintotp.generate(secret)`.
Upgrade
Version history
0.3.0latest on PyPI · released Feb 15, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
16
OpenAI (training)
1
Resources
mintotp — pip install mintotp · libregistry