Releases: puid/Python
puid 1.0.0
puid for Python
Simple, flexible and efficient generation of probably unique identifiers (puid
, aka random strings) of intuitively specified entropy using pre-defined or custom characters (including Unicode).
Installation
pip install puid_py
Overview
puid
provides intuitive and efficient generation of random IDs. For the purposes of puid
, a random ID is considered a random string used in a context of uniqueness, that is, random IDs are a bunch of random strings that are hopefully unique.
Random string generation can be thought of as a transformation of some random source of entropy into a string representation of randomness. A general purpose random string library used for random IDs should therefore provide user specification for each of the following three key aspects:
-
Entropy source
What source of randomness is being transformed?
puid
allows easy specification of the function used for source randomness -
ID characters
What characters are used in the ID?
puid
provides 16 pre-defined character sets, as well as allows custom characters, including Unicode -
ID randomness
What is the resulting “randomness” of the IDs?
puid
allows an intuitive, explicit specification of ID randomness
The project README contains detailed usage and project motivation.
tl;dr
puid
is a simple, flexible and efficient random ID generator:
-
Ease
Random ID generator specified in one line of code
-
Flexible
Full control over entropy source, ID characters and amount of ID randomness
-
Secure
Defaults to a secure source of entropy and at least 128 bits of ID entropy
-
Efficient
Maximum use of system entropy
-
Compact
ID strings represent maximum entropy for characters used
-
Explicit
Clear specification of ID generation