Skip to content

v5 does not generate the correct UUID #30

Closed

Description

@turicas

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

Activity

  1. th-alanreed commented on Dec 2, 2021

    @th-alanreed
    Owner

    Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions