Skip to content

Commit a6672e9

Browse files
roverwolfjaviereguiluz
authored andcommitted
[Uid] Add note about ULIDs not being random in one case
1 parent b300df4 commit a6672e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/uid.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ ULIDs are an alternative to UUIDs when using those is impractical. They provide
209209
128-bit compatibility with UUID, they are lexicographically sortable and they
210210
are encoded as 26-character strings (vs 36-character UUIDs).
211211

212+
.. note::
213+
214+
If you generate more than one ULID during the same millisecond in the
215+
same process then the random portion is incremented by one bit in order
216+
to provide monotonicity for sorting. The random portion is **not**
217+
random compared to the previous ULID in this case.
218+
212219
Generating ULIDs
213220
~~~~~~~~~~~~~~~~
214221

0 commit comments

Comments
 (0)