gofrs / uuid

A UUID package for Go
MIT License
1.58k stars 111 forks source link

update UUIDv7 implementation with RFC Draft Rev 03 spec #99

Closed convto closed 2 years ago

convto commented 2 years ago

Currently, UUIDv6 and UUIDv7 implementations follow RFC draft rev 02 [1]. However, it has already been updated by RFC draft rev 03 [2] in March 2022.

Rev3 updates v6 and v7 and v8 specifications, but the v6 changes seem to have no impact on implementation. Therefore, v6 and (unimplemented) v8 are not affected, so only the UUIDv7 implementation will be updated.

[1] https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-02 [2] https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03

In rev 03, complex sequences and variable precision timestamps have been removed from the specification. The implementation is now simple and lock-free. It looks good.

This PR has breaking changes to the signature of the exported function NewV7() and Gen.NewV7() , but this does not seem to need consideration. I have referenced the following comment. https://github.com/gofrs/uuid/blob/028e8409cdd0ed11a2b5bb3feb1ae2285ebb94fa/generator.go#L92-L97

convto commented 2 years ago

@theckman I saw you had recently implemented a Rev02 draft on https://github.com/gofrs/uuid/pull/93 PR! I think you seem like a very good reviewer of this PR.

If you're the right member for the review, I'd appreciate your review if you have the time needed. :bow:

convto commented 2 years ago

I checked with gophers slack, @theckman seems to be in a situation where he can't do reviews...

convto commented 2 years ago

@cameracker I see you have contributed a lot to this project! If you have enough time, I would appreciate it if you could review this PR. 🙇

convto commented 2 years ago

@cameracker I don't have write access to the project, Could the maintainer members do the merging and releasing?

cameracker commented 2 years ago

Thank you so much for the submission @convto :) It's nice to have the WIP versions of the new uuid features in the library. Thanks for keeping them up to date 👍