Generate 64bit UUIDs
Project description
This is a simple script that generates a 64bit UUID. The normal type of UUID (e.g. those available in the uuid module) are 128bit, which provides substantially greater ability to avoid collision between generated values. However, it is sometimes convenient to have a smaller UUID, e.g. if the number of generated values is not terribly large or will not be generated in large batches. Or, perhaps, due to a lack of support for 128bit integers.
The algorithm used to generate these UUIDs is very simple. The UUID consists of two 32bit parts. The first part is base upon the current time (seconds since the beginning of epoch). When UUIDs are not generated in batches, i.e. all at the same time, the time acts as an incrementing value so that UUID generate many seconds apart are almost certain to be different (note that clock timing on different machines means that this is not a guarantee).
The second part is a 32bit random number taken from the system that the script is running on, e.g. on linux the value is taken from /dev/urandom rather than a pseudo-random generator.
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
File details
Details for the file uuid64-0.2.0.tar.gz
.
File metadata
- Download URL: uuid64-0.2.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b94be28beeb9bed34d2e2d3f7f5c7bddc0b18bae54d3be3740e81b78218e325 |
|
MD5 | 9202243450b12b16a777778db07f914b |
|
BLAKE2b-256 | e862f9ba192d4400667fb0f3a899cf40a0372de99e5a848558bcf9c4a42d021e |