-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add UUID tests and fix version 5 bits #1362
chore: Add UUID tests and fix version 5 bits #1362
Conversation
Wow, this is going to rekey everything. Can you say more about the bit change, why is this more correct, what problems could we see if we don't fix it? |
I discovered the issue while writing tests for the UUID function. Our generated UUIDs weren't strictly setting the version and variant bits as per RFC 4122, which could cause inconsistencies or invalid v5 UUIDs. This fix ensures proper compliance and interoperability, though it does change UUIDs previously generated for the same input. If we decide we’d rather avoid re-keying right now, I can open a separate PR that includes only the new tests, excluding this bit-fix. |
IMO better to do it now than later, I just wanted to make sure we had all the relevant info at hand to justify the decision. |
I’ve just updated the PR description to reflect the impact of the version-bit fix. I propose splitting these changes into two PRs:
Since the second part can be disruptive, I’d appreciate guidance or help on how best to handle existing data or references. Let me know your thoughts. |
Removed the change from this PR feel free to add it in a separate PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…fix-version chore: Add UUID tests and fix version 5 bits
What this PR does
stringToUuid
function:hashBuffer[6]
to0x5
.(hashBuffer[6] & 0x0f) | 0x50
.Why this matters
Risks & Impact
Next Steps