Open serhattanrikut opened 1 year ago
Hi @serhattanrikut - I checked the linked issue (and the issues/PRs linked therein) and yes, I would accept such a fix on this fork.
Not sure if I have the time right now to get to it myself, but I would certainly accept a PR for it.
@perry-mitchell Does the existing Monotonic ULID factory support this now? Should this issue be closed?
No, I don't think anything was merged for this. I'm not confident I can test this exact eventuality correctly so it'd be better if someone with more experience on this would contribute a patch.
Hello @perry-mitchell
Do you plan to fix the issue mentioned in ulid/javascript#74 -->
If multiple UUIDs are generated in the same millisecond, the random bits are not guaranteed to be monotonically increasing. So given const [a, b, c] = [ulid(), ulid(), ulid()] c and b could sort lower than a
This implementation already has an algo for incrementing the base32 of the ulid. It should just change to increment the most significant bits instead of the least significant bits of the random portion.
Thanks.