Skip to content
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

v1 <-> v6 transformation, v6 generation #684

Open
broofa opened this issue Feb 4, 2023 · 3 comments
Open

v1 <-> v6 transformation, v6 generation #684

broofa opened this issue Feb 4, 2023 · 3 comments
Labels
bis Issues related to RFC4122bis specification stale-exempt Exempts issue from being marked as stale

Comments

@broofa
Copy link
Member

broofa commented Feb 4, 2023

The whole raison d'etre for version 6 is to provide interoperability with version 1. I.e. Version 6 is really only useful when operating in contexts where systems care about both version 1 and version 6 forms of a UUID (otherwise, version 7 should be used, instead).

Thus, I suggest our version 6 support should consist of the following:

  • v1tov6(v1uuid) - converts v1 UUID to v6, throws if v1uuid is not actually version 1
  • v6tov1(v6uuid) - converts v6 UUID to v1, throws if v6uuid is not actually version 6
  • v6() - convenience method for v1tov6(v1())
@broofa broofa added the bis Issues related to RFC4122bis specification label Feb 4, 2023
@github-actions
Copy link

github-actions bot commented May 6, 2023

Marking as stale due to 90 days with no activity.

@github-actions github-actions bot added the stale label May 6, 2023
@broofa broofa added stale-exempt Exempts issue from being marked as stale and removed stale labels May 6, 2023
@ludwhe
Copy link

ludwhe commented Nov 10, 2023

Interested in developing this :) For v1tov6 and v6tov1, if the input is a buffer, what should be preferred between replacing the provided value in-place or returning a new buffer?

@broofa
Copy link
Member Author

broofa commented Nov 10, 2023

Return a new buffer. Modifying state in-place is a bit of a code smell, especially since we (this library's authors) don't know how the input id might be used subsequent to this method being called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bis Issues related to RFC4122bis specification stale-exempt Exempts issue from being marked as stale
Projects
None yet
Development

No branches or pull requests

2 participants