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
Sort order does not respect millisecond ordering #22
Comments
owst
added a commit
to owst/ulid
that referenced
this issue
Sep 3, 2020
owst
added a commit
to owst/ulid
that referenced
this issue
Sep 3, 2020
rafaelsales
added a commit
that referenced
this issue
Mar 1, 2021
) (#23) * Ensure ULID order respects timestamp order to millisecond precision (#22) * fixup! Ensure ULID order respects timestamp order to millisecond precision (#22) * Update lib/ulid/generator.rb Thanks to @kachick Co-authored-by: Kenichi Kamiya <kachick1@gmail.com> Co-authored-by: Kenichi Kamiya <kachick1@gmail.com> Co-authored-by: Rafael Sales <rafaelcds@gmail.com>
Fixed by #23 |
kachick
added a commit
to kachick/ruby-ulid
that referenced
this issue
Apr 30, 2021
This was referenced Apr 30, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I read the spec in this repo, the lexicographical sort ordering of ULIDs should respect the timestamp ordering to millisecond precision. However, this does not appear to always be the case:
gives
The problem being that (in this example run) that
01EH9XXEV1NNSE20T5E9PDH4Q9
sorts after01EH9XXEV1HSVWPK0E776QR1ZX
, despite the timestamp used to generate the former being 1 millisecond before that of the latter. Looking at the timestamp portion of the two ULIDs, they are the same:01EH9XXEV1
, which means both2020-09-03 13:09:00.001
and2020-09-03 13:09:00.002
map to the same ULID prefix.The text was updated successfully, but these errors were encountered: