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

Fix lexicographic ordering when timestamps are the same #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheInnerLight
Copy link

ULIDs are currently not lexicographically sortable unless they have the same timestamp.

This is also has alarming consequences where members Sets of ULID will be treated as equal if the timestamps are the same but have different random components.

This change ensures that they will be sorted correctly even if the timestamps are identical.

See also: #15

@ad-si
Copy link
Member

ad-si commented Oct 24, 2024

Great addition, thanks! However, can you maybe also add a section to the readme explaining the issue including a warning that ULIDs are sorted based on the random part, even though this is not necessarily the order they were created in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants