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

Incorrect uuidv6 implementation #159

Open
ygllq opened this issue Mar 20, 2024 · 1 comment
Open

Incorrect uuidv6 implementation #159

ygllq opened this issue Mar 20, 2024 · 1 comment

Comments

@ygllq
Copy link

ygllq commented Mar 20, 2024

RFC 4122 UUIDv6 Example: 1EC9414C-232A-6B00-B3C8-9E6BDECED846
But in this library NewV6 generates ID like: 01eee693-1887-6e10-a722-9e6bdeced846 has a prefix 0

Many UUID libraries in other languages (for example python uuid6) follow the instructions of the RFC.

For UUIDv6, RFC also mentioned

The 48 bit node SHOULD be set to a pseudo-random value however implementations MAY choose to retain the old MAC address behavior from [RFC4122], Section 4.1.6 and [RFC4122], Section 4.5. For more information on MAC address usage within UUIDs see the Section 8

The last 48bit node can set to a pseudo-random value, it maybe more useful.

@it512
Copy link
Contributor

it512 commented Mar 27, 2024

I will check the first problem you report and fix it as soon as possible.
Regarding the second question , it is optional to use pseudo-randomness for the lower 48 bits of UUID1, 6. In addition, RFC recommends that you use uuidV7

=================

您反馈的第一个问题,我会查看,有问题会第一时间修复。
对于您反馈的第二个问题,UUID1,6 低48位使用伪随机是可选的,另外RFC推荐您用uuidV7,另外在任何情况下都应该优先考虑使用uuidV7
@ygllq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants