Skip to content

Commit 958a0eb

Browse files
committed
More prominently mention monotonic sort order support
1 parent 1227759 commit 958a0eb

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

README.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ A ``ULID`` is a *universally unique lexicographically sortable identifier*. It i
4242
* Uses Crockford's base32 for better efficiency and readability (5 bits per character)
4343
* Case insensitive
4444
* No special characters (URL safe)
45+
* Monotonic sort order (correctly detects and handles the same millisecond)
4546

4647
In general the structure of a ULID is as follows:
4748

@@ -150,6 +151,20 @@ The ``ULID`` class can be directly used for the popular data validation library
150151
151152
.. pydantic-end
152153
154+
.. monotonic-begin
155+
156+
Monotonic Support
157+
-----------------
158+
159+
This library by default supports the implementation for monotonic sort order suggested by the
160+
official ULID specification.
161+
162+
This means that ULID values generated in the same millisecond will have linear increasing randomness
163+
values. If :math:`r_1` and :math:`r_2` are the randomness values of two ULIDs with the same
164+
timestamp, then :math:`r_2 = r_1 + 1`.
165+
166+
.. monotonic-end
167+
153168
.. cli-begin
154169
155170
Command line interface
@@ -207,3 +222,9 @@ Other implementations
207222
* `ulid/javascript <https://github.com/ulid/javascript>`_
208223
* `RobThree/NUlid <https://github.com/RobThree/NUlid>`_
209224
* `imdario/go-ulid <https://github.com/imdario/go-ulid>`_
225+
226+
Contributions
227+
-------------
228+
229+
Contributions are welcome! Feel free to create pull-requests for issues or feature requests.
230+
It might be worth creating an issue upfront to discuss the matter.

docs/source/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Release v\ |release| (:ref:`What's new <changelog>`)
2020
:start-after: pydantic-begin
2121
:end-before: pydantic-end
2222

23+
.. include:: ../../README.rst
24+
:start-after: monotonic-begin
25+
:end-before: monotonic-end
26+
2327
.. include:: ../../README.rst
2428
:start-after: cli-begin
2529
:end-before: cli-end

0 commit comments

Comments
 (0)