You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you receive an ULID from some external source (e.g. a database) you might want to compute the next following ULID. This is useful for range-style queries where you are trying to retrieve every item after the aforementioned ULID. The library already does so internally to provide monotonic values but it's not entirely clear how to get the monotonically "next" ULID, given another one.
Example:
prev=ulid.parse(some_str) # From external sourcenext= ... # ???
I was playing with ulid.create but I couldn't quite figure it out. It seems to be that bumping the randomness by one and if that overflow bumping the timestamp by one is what we want.
A ULID.next method would be really nice.
The text was updated successfully, but these errors were encountered:
If you receive an ULID from some external source (e.g. a database) you might want to compute the next following ULID. This is useful for range-style queries where you are trying to retrieve every item after the aforementioned ULID. The library already does so internally to provide monotonic values but it's not entirely clear how to get the monotonically "next" ULID, given another one.
Example:
I was playing with
ulid.create
but I couldn't quite figure it out. It seems to be that bumping the randomness by one and if that overflow bumping the timestamp by one is what we want.A
ULID.next
method would be really nice.The text was updated successfully, but these errors were encountered: