uuid7 icon indicating copy to clipboard operation
uuid7 copied to clipboard

Get timestamp working with millisecond accuracy, add tests

Open nickhobbs94 opened this issue 2 years ago • 4 comments

I noticed that the UUIDs from this library weren't matching what I was getting from packages in npm. I then saw this issue which said it was definitely a problem: https://github.com/stevesimmons/uuid7/issues/1

I've gone ahead and dropped nanosecond support to get this library matching the results of other ones. It looks like the variable accuracy timestamps have been dropped from the latest draft I can find of the UUIDv7 spec and it's just millisecond accuracy now: https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-7

Let me know if you think I've done anything wrong or you're not happy with a direction I've taken. Happy to fix up any issues.

nickhobbs94 avatar Sep 12 '23 11:09 nickhobbs94

Note this will be a breaking change in the ordering and may need to be indicated with a version bump

nickhobbs94 avatar Sep 12 '23 11:09 nickhobbs94

I noticed that the UUIDs from this library weren't matching what I was getting from packages in npm. I then saw this issue which said it was definitely a problem: #1

I've gone ahead and dropped nanosecond support to get this library matching the results of other ones. It looks like the variable accuracy timestamps have been dropped from the latest draft I can find of the UUIDv7 spec and it's just millisecond accuracy now: https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-7

Let me know if you think I've done anything wrong or you're not happy with a direction I've taken. Happy to fix up any issues.

I used your code to update uuid7.com with the millisecond precision draft, thanks for the code!

https://github.com/RzNmKX/uuid7-flask/issues/1

RzNmKX avatar Mar 21 '24 03:03 RzNmKX