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

Duplicate UUIDs - V5 inconsistencies when using UTF8/Unicode characters #111

Closed
vjamrich opened this issue Mar 29, 2024 · 3 comments
Closed

Comments

@vjamrich
Copy link
Contributor

vjamrich commented Mar 29, 2024

Two different input names can result in the same v5 UUID - e.g. & 人 will both be encoded to f7cd5579-8db4-5043-bd83-98565a62a4f4
This is caused by the v5 not working properly with UTF8 characters.

Dart

import "package:uuid/uuid.dart";
final String key = const Uuid().v5(Uuid.NAMESPACE_X500, "人");
print(key);

Output: f7cd5579-8db4-5043-bd83-98565a62a4f4

Python

import uuid
key = uuid.uuid5(
    namespace=uuid.NAMESPACE_X500,
    name="人",
)
print(key)

Output: 3af28677-8030-59ef-81a6-051ddf226fad

Expected Output

The output String should be consistent.

@vjamrich
Copy link
Contributor Author

@daegalus created the following pull request: #112

@vjamrich vjamrich changed the title V5 inconsistencies when using UTF8/Unicode characters Duplicate UUIDs - V5 inconsistencies when using UTF8/Unicode characters Mar 29, 2024
@daegalus
Copy link
Owner

I merged the PR. good catch. Did not conisder UTF8. I will add some tests to cover regressions.

@daegalus
Copy link
Owner

daegalus commented Apr 8, 2024

The fix is now part of the v4.4.0 release, sorry for the delay, there were other problems I had to fix due other problems fixed as part of the release.

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