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
I see that all the methods in Generator are currently infallible. It certainly makes sense, in order to be sure that the timestamp part of the ULID stays technically correct.
However, I'd argue that most of the time the system clock is not set to millisecond accuracy, and fewer than 2**80 ULIDs are generated per second.
As such, I'd like to introduce an infallible Generator::generate_overflowing() (or similar name) method, that'd just make +1 to the u128 in case the randomly-generated ULID was before the last one output, and still allow overflow in the time bits.
Would you be interested in such a PR?
The text was updated successfully, but these errors were encountered:
Hey!
I see that all the methods in
Generator
are currently infallible. It certainly makes sense, in order to be sure that the timestamp part of the ULID stays technically correct.However, I'd argue that most of the time the system clock is not set to millisecond accuracy, and fewer than 2**80 ULIDs are generated per second.
As such, I'd like to introduce an infallible
Generator::generate_overflowing()
(or similar name) method, that'd just make+1
to theu128
in case the randomly-generated ULID was before the last one output, and still allow overflow in the time bits.Would you be interested in such a PR?
The text was updated successfully, but these errors were encountered: