Closed broofa closed 5 months ago
Marking as stale due to 90 days with no activity.
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?
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.
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 ifv1uuid
is not actually version 1v6tov1(v6uuid)
- converts v6 UUID to v1, throws ifv6uuid
is not actually version 6v6()
- convenience method forv1tov6(v1())
Note: When converting v1 -> v6, RFC9562 suggests the
node
andclock_seq
fields be replaced with random values per 9562. So there should be an option for this.