3 ms·
If it's random value, then generated UUIDs won't always be ascending which defeats purpose as well.
by vbezhenar 3y ago
If it's random value, then generated UUIDs won't always be ascending which defeats purpose as well.
- hn_throwaway_99 3y agoNo, that's not really it either. ULIDs have both a time component (in this case accurate to the millisecond) and a random component. Thus the order is always accurate up to the ms, and for the vast majority of applications anything created in the same millisecond can be considered created "at the same time", so it's usually OK if order is undetermined within the same MS. Note that the UUID v7 spec is largely modeled after the ULID spec. ULIDs came first, and they traded the "standard" UUID format of 8x-4x-4x-4x-12x hex string for the more compact Crockford base32 format, and there are some other minor differences in number of timestamp bits vs. number of random bits, but they are otherwise functionally equivalent.