Skip to main content

Generate a time-based OTP using SHA-256 hashing algorithm

Project description

OTP Generator

Generate a time-based OTP using SHA-256 hashing algorithm.

Installation

You can install the package using pip:

pip install ownotp

Usage

Create 6 digits otp. OTP will change 2 minutes once based on your_own_secrent.

from ownotp.otp import generate_otp

otp = generate_otp('your_own_secret')
print(otp)

To change interval time, pass the value in seconds.

from ownotp.otp import generate_otp
otp = generate_otp('your_own_secret', interval=120)

To generate different length OTP.

Note: Minium 4 and Maximum 8 length will support. If condition not satisfied default length will take to generate OTP.

from ownotp.otp import generate_otp
otp = generate_otp('your_own_secret', length=7)

To get hashed OTP. Mixed of char and numbers

from ownotp.otp import generate_otp
otp = generate_otp('your_own_secret', only_digits=False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ownotp-0.1.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ownotp-0.1.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file ownotp-0.1.2.tar.gz.

File metadata

  • Download URL: ownotp-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for ownotp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1337ff22ef4861c1825337285af425ce796148d908075f4e63518184de8fc7b4
MD5 dde53b9055df9455b0080a5a71d08d7b
BLAKE2b-256 2ac30da96ed7e7e72a265da75b976a227bfc67f709c0a03d48b8a780396a30a2

See more details on using hashes here.

File details

Details for the file ownotp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ownotp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for ownotp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 201f889af0124901020bb145ec1872b721842b6e5d1c4efe597fa8e6f17c64f0
MD5 29828cf602ababa3a3f825e1814ba754
BLAKE2b-256 451cb1e787f78116de2faf0038b45ef93e27bf3d839968d12db415f356d98fe7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page