gofrs / uuid

A UUID package for Go
MIT License
1.55k stars 108 forks source link

Update to RFC 9562 #117

Closed kohenkatz closed 2 months ago

kohenkatz commented 1 year ago

~On 2022-10-17, the IETF uuidrev workgroup published a new draft that replaces peabody draft 04. On 2023-11-06, they released draft 14.~ On 2024-05-07, the IETF published RFC 9562, obsoleting RFC 4122.

This PR updates this project to implement the newest RFC. (fixes #118)

There are a few changes in documentation: mostly pointing to the new RFC URL, and adding comments as appropriate to explain the changes.

A new constant VariantRFC9562 is added, with the old VariantRFC4122 kept as an alias to it for backward compatibility.

The one major code change is in the implementation of UUID version 6. Since draft-01, this version now SHOULD use new pseudo-random data for the final 62 bytes, instead of using a clock_seq value for 14 of those bytes. (Although implementations MAY keep the old clock_seq behavior, this is discouraged, and is only allowed alongside keeping the MAC address as the node value. Since we are not keeping the MAC address, we also should not keep the clock_seq.

kohenkatz commented 4 months ago

Sorry for the 13-month delay on this! I think it is ready for review now.

cameracker commented 2 months ago

I just realized the coverage isnt running anymore...

cameracker commented 2 months ago

Got codecov set back up but it probably wont run on this until we merge. I added @dylan-bourque to the review to see if he has any feedback, but the changes seem correct to me and consistent with the verbiage in the latest RFC. Thank you for taking the time to update this.

dylan-bourque commented 2 months ago

I gave this a quick scan and didn't see anything. I'm traveling today so won't have a chance to do a deeper review probably until Monday.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (22c52c2) to head (a3cbee1). Report is 2 commits behind head on master.

:exclamation: Current head a3cbee1 differs from pull request most recent head e2280ed. Consider uploading reports for the commit e2280ed to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #117 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 4 4 Lines 513 498 -15 ========================================= - Hits 513 498 -15 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.