From 0568815f7b7368a9a7b302f7e09a9d7a7a820518 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Wed, 26 Jan 2022 01:25:19 +0100 Subject: [PATCH] README: clarify monotonicity requirements --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 509c4eb..f461295 100644 --- a/README.md +++ b/README.md @@ -134,8 +134,7 @@ Crockford's Base32 is used as shown. This alphabet excludes the letters I, L, O, ### Monotonicity -When generating a ULID within the same millisecond, we can provide some -guarantees regarding sort order. Namely, if the same millisecond is detected, the `random` component is incremented by 1 bit in the least significant bit position (with carrying). For example: +When generating a ULID within the same millisecond, implementations may optionally provide monotonicity by statefully incrementing the `random` component rather than regenerating it. ```javascript import { monotonicFactory } from 'ulid' @@ -147,7 +146,7 @@ ulid() // 01BX5ZZKBKACTAV9WEVGEMMVRZ ulid() // 01BX5ZZKBKACTAV9WEVGEMMVS0 ``` -If, in the extremely unlikely event that, you manage to generate more than 280 ULIDs within the same millisecond, or cause the random component to overflow with less, the generation will fail. +Generating more than 280 ULIDs within the same millisecond, or causing the random component to overflow, will result in an error. ```javascript import { monotonicFactory } from 'ulid'