Skip to content

v1 <-> v6 transformation, v6 generation #684

@broofa

Description

@broofa

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())

Note: When converting v1 -> v6, RFC9562 suggests the node and clock_seq fields be replaced with random values per 9562. So there should be an option for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale-exemptExempts issue from being marked as stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions