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

v5 does not generate the correct UUID #30

Closed
turicas opened this issue Dec 1, 2021 · 1 comment
Closed

v5 does not generate the correct UUID #30

turicas opened this issue Dec 1, 2021 · 1 comment

Comments

@turicas
Copy link

turicas commented Dec 1, 2021

I can't generate the correct UUID v5 using the URL namespace (6ba7b811-9dad-11d1-80b4-00c04fd430c8). In Python:

In [1]: import uuid

In [2]: uuid.uuid5(uuid.NAMESPACE_URL, 'https://id.brasil.io/company/v1/07725215/')
Out[2]: UUID('cea67166-41d3-5c40-8bc9-7c922188f57f')

In the website:
uuidv5-bug

I tried to generate by selecting the namepace URL and also entering the namespace UUID (6ba7b811-9dad-11d1-80b4-00c04fd430c8), both result in the same (wrong) UUID (b53e1b57-1e6a-52cc-8efd-9769b1f08bce).

The problem: the code removes the trailing / in the URL (this issue may be related to #10). Checking using Python:

In [1]: import uuid

In [2]: uuid.uuid5(uuid.NAMESPACE_URL, 'https://id.brasil.io/company/v1/07725215')
Out[2]: UUID('b53e1b57-1e6a-52cc-8efd-9769b1f08bce')
@aarreedd
Copy link
Owner

aarreedd commented Dec 2, 2021

Thanks for reporting this.

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