Skip to main content

A simple otp generate package

Project description

OTP GENERATOR

This project was created to produce a unique one-time password (OTP) using either a mobile or ten-digit number. The key idea behind the OTP is that it does not repeat itself. For instance, if you provide an interval time in minutes, the OTP generated will be based on that interval. For example, if you set the interval to five minutes, the same OTP will be generated for five minutes. If you do not specify an interval, the default time of two minutes will be used and the same OTP will be generated for two minutes.

What is it?

OTP generator is the python package, This package only used for generate otp only using hashlib and sha.

Installation

You can install the package using pip:

pip install otp-generate

Usage

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

from otp_generate import generate_otp
    
otp = generate_otp('your_own_secret_key')
print(otp)

To change interval time pass the value in minutes.

from otp_generate import generate_otp
otp = generate_otp('your_own_secret', interval=5)

To get 7 or 8 length otp.

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

To get hashed OTP. Mixed of char and numbers

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

Where to get it

The source code is currently hosted on GitHub at: https://github.com/Starsystems-sangli/wa-otp-generate

License

MIT License

Copyright (c) 2024 STAR SYSTEMS INDIA PVT LTD

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

otp_generate-0.0.6.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

otp_generate-0.0.6-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file otp_generate-0.0.6.tar.gz.

File metadata

  • Download URL: otp_generate-0.0.6.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for otp_generate-0.0.6.tar.gz
Algorithm Hash digest
SHA256 01113efe243705189c7b2e4e28cd649a5f83fc75b4d02a330f0d5029739ecbfc
MD5 99974bb367358706990c090403af9f9c
BLAKE2b-256 82fa633816fd8d21ab639a726f9d8bc64ef2859eb7df09fb82211f7f6e7c220b

See more details on using hashes here.

File details

Details for the file otp_generate-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: otp_generate-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for otp_generate-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a541caf68e5231ad4a82933f80fa5fa9e704ae081a968a5cf47c54cd47d5bc53
MD5 b24a13d35c04afa4d191a0bb8ae49242
BLAKE2b-256 d5be7e18958d256f5a9b7c87276e58496feea1a49f5d0f9d3351e748b17b9fa9

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