Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Serial number generator/validator

Project description

gubbins

Serial number generator/validator

A simple but powerful serial number generator and validator written in Python. Given a Prefix and a 32-bit ID, produces a Serial. Given a valid Serial, returns the Prefix and 32-bit ID. Optionally takes Additional Data.

from gubbins import Gubbins

for i in range(10):
	serial = Gubbins.generate("AX", i)
	prefix, id = Gubbins.validate(serial)
	assert prefix.lower() == "AX".lower()
	assert id == i
	print(i, serial)

or via the command-line,

python3 -m gubbins.generate 1-10 --solo --prefix AX | python3 -m gubbins.validate

Requires

License: MIT

Project details


Download files

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

Files for gubbins, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size gubbins-0.0.3-py3-none-any.whl (5.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size gubbins-0.0.3.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page