Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monotonically increasing guarantee in the same millisecond #14

Open
serhattanrikut opened this issue Jan 12, 2023 · 3 comments
Open

Monotonically increasing guarantee in the same millisecond #14

serhattanrikut opened this issue Jan 12, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@serhattanrikut
Copy link

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.

@perry-mitchell
Copy link
Owner

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 perry-mitchell added the enhancement New feature or request label Jan 12, 2023
@perry-mitchell perry-mitchell added the help wanted Extra attention is needed label Feb 12, 2023
@paynecodes
Copy link

@perry-mitchell Does the existing Monotonic ULID factory support this now? Should this issue be closed?

@perry-mitchell
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants