Skip to main content

gen4id a simple but maybe useful package for auto-increment ids

Project description

Installation

Usage

pip install gen4id

Normal

from gen4id import IncreaseGen
ic = IncreaseGen(key_len=8)
uid = ic.encode(increase_id=10)
print(uid)

Use Random String

by default, it user the gen4id.increase_gen.MIXED as the random string for choose, you can use a generate random string for you application

from gen4id import random_str,IncreaseGen
from gen4id.increase_gen import MIXED

rstr = random_str(MIXED)
ic = IncreaseGen(choose=rstr,key_len=10)
uid = ic.encode(increase_id=10)
print(uid)

Add Digit Check Bit

from gen4id import random_str,IncreaseGen
from gen4id.increase_gen import MIXED

rstr = random_str(MIXED)
ic = IncreaseGen(choose=rstr,key_len=10,digit=True,digit_bit=2)
uid = ic.encode(increase_id=10)
print(uid)

More

To Be Continue ….

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

gen4id-1.0.2.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file gen4id-1.0.2.tar.gz.

File metadata

  • Download URL: gen4id-1.0.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for gen4id-1.0.2.tar.gz
Algorithm Hash digest
SHA256 be497448311ce347abb64d03bdb7d21e3f6b16daf54ec35a0d113e46024c5a7a
MD5 ecca9f842de977948ef21b4e91dd384b
BLAKE2b-256 cca23aad1614d624de74b6e42908791ec7aafd5022e3336647583b09b33809d3

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