Short id generator
Project description
Python ShortId and SnowflakeId
short_id
is a Python 3 library that provides an easy way to generate a short unique id in an orderly way using the snowflake id generation method
- short id with ordered way
- snowflake id as ordered unique number
- short id with more unique without order
short_id
hosted on PyPI and can be installed as such:
pip install install ShortId
Alternatively, you can also get the latest source code from Github and install it manually.
import short_id
unique_id :str = short_id.generate_short_id()
snowflake_id :int = short_id.get_next_snowflake_id()
# To increase id accuracy need to send a mult value the default value is 10000
# and based on this mult value the id length and accuracy will change
unique_id :str = short_id.generate_short_id(1000000)
snowflake_id :int = short_id.get_next_snowflake_id(1000000)
Running Tests
python -m unittest discover
Changelog
Version 0.1.2
- Initial release
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
short-unique-id-0.1.2.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for short_unique_id-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62cf689a0368809a20e02cced075d18c54a5a1cf161c6743b70f1bb32283abf0 |
|
MD5 | 3888c2f381d2d74ede099fa37fa46239 |
|
BLAKE2b-256 | 475c3c9e9aab8ff248fb5116f12e061bc2d11bc472041572ecca391b86f6e0af |