cuid.py
Implementation of https://github.com/ericelliott/cuid in Python.
A cuid is a portable and sequentially-ordered unique identifier designed for
horizontal scalability and speed -- this version is ported from the reference
implementation in Javascript.
NOTE: Particularly if you have security concerns, the cuid standard has been deprecated in favor of cuid2!
Tested on CPython 2.7, 3.6-3.11 as well as PyPy & PyPy3.
Rough benchmarks on my machine (i7-8750H CPU @ 2.20GHz) using setup.py bench
(which times the creation of 1 million cuids):
| Version | ns / cuid |
|---|---|
| CPython 3.7.3 | 6095.257 |
| CPython 3.6.8 | 6846.050 |
| CPython 3.5.6 | 6604.012 |
| CPython 2.7.16 | 6913.681 |
| PyPy 7.1.1 (Python 2.7.13) | 326.344 |
| PyPy3 7.1.1 (Python 3.6.1) | 562.673 |
(Note that timing the creation of fewer IDs changes the way PyPy runs the code, because of JIT warmup -- obviously creating this many IDs takes advantage of the warmed JIT)
For now, this has no dependencies outside the standard library -- in time this may change, to provide better random numbers and / or performance.
Metadata
Release files for cuid 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cuid-0.4.tar.gz | 5.0 kB | Without provenance | Details for cuid-0.4.tar.gz |
Release files / cuid-0.4.tar.gz
| Download URL | cuid-0.4.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74eaba154916a2240405c3631acee708c263ef8fa05a86820b87d0f59f84e978
|
|
BLAKE2b-256 checksum How to use checksums |
55cad323556e2bf9bfb63219fbb849ce61bb830cc42d1b25b91cde3815451b91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for cuid 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.