issue with uuidv5 and/or parse function - Invalid UUID
See original GitHub issueDescribe the bug
A GUID generated in dotnet is failing to parse. We get an error: Invalid UUID. We encountered the issue with v5, but it’s the same error if you pass to the new parse function. I ran git bisect using this test and it fails starting on commit: 0e6c10ba1bf9517796ff23c052fc0468eedfd5f4.
describe('v5', () => {
test('should parse', () => {
const id1 = v5('test', 'de42f6ff-210c-da9c-a30e-1a4ac2743656');
});
});
How to reproduce
Run this test:
describe('v5', () => {
test('should parse', () => {
const id1 = v5('test', 'de42f6ff-210c-da9c-a30e-1a4ac2743656');
});
});
Expected behavior
Should produce a v5 uuid.
Runtime
- OS: [macOS, Linux]
- Runtime: [e.g. Node.js, AWS Lambda]
- Runtime Version: [e.g. 12x]
Additional information
[Any other information or comments that you think will help]
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Generating uuid v5 in node.js erros out with no information?
I want to egenrate a v5 uuid. I can generate a v4 no problem by requiring the module: const { v4: uuidv4 }...
Read more >uuidv5 - Functions - Configuration Language | Terraform
The uuidv5 function generates a uuid v5 string representation of the value in the specified namespace.
Read more >UUID:fromString() parses incorrect strings without error
Bug - A problem which impairs or prevents the functions of the product. JDK-8216407 java.util.UUID.fromString accepts input that does not match expected format....
Read more >UUIDs - Go Packages
The uuid package generates and inspects UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services. This package is based on...
Read more >Recalculate UUIDs for Vulnerabilities::Findings using UUIDv5
Important Note: Rails UUID V5 generation method has a flaw inside which results in creating wrong UUIDs if the namespace ID is also...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok. So I was wrong about it coming from dotnet. It actually originates from an old titanium based mobile app with a handwritten random number generator that just orders the chars/digits into a guid format. Pretty bad. (I did do some testing with the MS Guid.newGuid() method and it seems compliant).
I definitely see that the ID is non-compliant and now we know why. I’m now in the pinch of figuring out how to move forward. Our design/architecture relies heavily on uuidv5 and now I’ve found that I have a mountain of legacy data that won’t be compatible. For now I can pin the library at 8.2. Not a great long-term solution though. On my end I’m going to see if I can convince the product team to fix the uuid generation and ideally have a conversion strategy for older data.
FWIW, I think there’s some misconceptions around the synonymity of Microsoft GUIDs and RFC4122. Lots of articles out there conflating these two terms, often claiming they’re identical. However, Microsoft is pretty clear that GUIDs are allowed to contain any hex digit.
As @ctavan notes, RFC UUIDs have specific requirements for the
version
andvariant
fields, whereas GUIDS can have any hex digts there. I.e. The current behavior - where this library considers Microsoft GUIDs that don’t comply with the RFC spec to be invalid - is the intended behavior.