https://github.com/suminb/temporaluuid64
A time-based 64-bit UUID generator
https://github.com/suminb/temporaluuid64
Last synced: 2 months ago
JSON representation
A time-based 64-bit UUID generator
- Host: GitHub
- URL: https://github.com/suminb/temporaluuid64
- Owner: suminb
- Created: 2016-02-06T08:07:58.000Z (over 10 years ago)
- Default Branch: develop
- Last Pushed: 2026-04-01T03:45:07.000Z (3 months ago)
- Last Synced: 2026-04-01T05:48:39.141Z (3 months ago)
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Temporal UUID64
===============
A time-based 64-bit UUID generator. The basic idea behind is to provide a
universally unique identifier that satisfies the following conditions:
Installation
------------
.. code-block::
pip install temporaluuid64
Technical Details
-----------------
The time-based UUID consists of two components: a timestamp and a node ID.
.. code-block::
+----------------------+--------------------+
| 48-bit (timestamp) | 16-bit (node_id) |
+----------------------+--------------------+
Sort entities in chronological order
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entities given their UUIDs must be able to be sorted in chronological order
without relying on additional data fields. This is why the timestamp bits
occupy the most significant bits.
Suitable for distributed systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Even if multiple identifiers are created at the exactly same time, given a
particular granularity (generally a millisecond), the UUID generator must be
able to provide a way to avoid collisions.