Generates unique ids based on the current time, process and machine name. This package is an adaptation of a widely popular node module of the same name.
pip3 install pyuniqid
from pyuniqid import uniqid
print(uniqid()) # -> 4n5pxq24kpiob12og9
- Very fast
- Generates unique id's on multiple processes and machines even if called at the same time.
- With the current time the ID's are always unique in a single process.
- With the Process ID the ID's are unique even if called at the same time from multiple processes.
- With the MAC Address the ID's are unique even if called at the same time from multiple machines and processes.
Generate unique ids based on the time, process id and mac address. Works on multiple processes and machines.
uniqid() -> "4n5pxq24kpiob12og9"
uniqid('hello-') -> "hello-4n5pxq24kpiob12og9"
uniqid('hello-', '-goodbye') -> "hello-4n5pxq24kpiob12og9-goodbye"
# usage with suffix only
uniqid('', '-goodbye') -> "4n5pxq24kpiob12og9-goodbye"