A lightweight in-memory OTP generator and verifier with external record support
Project description
GVOTP
A lightweight in-memory OTP (One-Time Password) generator and verifier with external record support.
Installation
pip install gvotp
Usage
from gvotp import GVOTP
otp_manager = GVOTP()
result = otp_manager.generate_otp("email", "user@example.com")
(Optional step only if otp to be stored externally but preferred mode)
'''
otp_doc = result["otp_record"]
# Example otp record to be stored in DB
{
'kind': 'email',
'receiver': 'user@example.com',
'otp_hash': '4d300c1f42ba868c8a279c4b232de487f8012a7a76384b79173bc22b08351d8f',
'attempts': 0,
'create_time': 1750093088,
'ttl': 900
}
'''
otp = result["otp"]
# With in-memory store
otp_manager.verify_otp("email", "user@example.com", otp)
# If record stored externally
otp_doc =
otp_service.verify_otp("email", "user@example.com", response["otp"], document=otp_doc)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gvotp-0.1.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
gvotp-0.1.0-py3-none-any.whl
(3.3 kB
view details)
File details
Details for the file gvotp-0.1.0.tar.gz.
File metadata
- Download URL: gvotp-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
380fc82cdc8b3a3e7f58b8eccc202da99aa8f0e0e0b3f7bdd9dd8a32f5cc608f
|
|
| MD5 |
1d152be9edc821a252e63c699443fb9a
|
|
| BLAKE2b-256 |
e5c789dba1b8ccf38d569fce8ad18ddb74eecb4c4394657992fba0d82071c6f0
|
File details
Details for the file gvotp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gvotp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0f32eeb8e5b5f683134598359b13f5d8c0d8d10eec5cd0d9a3d075fcc10c460
|
|
| MD5 |
bf9eb2e0d7fee19e77d2369b567a87f0
|
|
| BLAKE2b-256 |
f07a2f39783f4c95d177d986dcdf0ca7678a7315739c9a2418da3bf9791e5c53
|