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

Binary representation of UUID incorrect #6

Open
ethandbrown opened this issue Feb 4, 2014 · 1 comment
Open

Binary representation of UUID incorrect #6

ethandbrown opened this issue Feb 4, 2014 · 1 comment

Comments

@ethandbrown
Copy link

Conversion of string to binary, and then back from binary to string works correctly when both conversions are made using the Data::UUID module. However the binary representation is not compatible with other libraries. When the string
41324657-9abb-401c-8533-745846b948f7
is converted to binary, the command
od -t x1
shows the binary as
57 46 32 41 bb 9a 1c 40 85 33 74 58 46 b9 48 f7
The left portion of the bytes are transformed.
Using the module UUID::Tiny, the od -t x1 output matches the string:
41 32 46 57 9a bb 40 1c 85 33 74 58 46 b9 48 f7

@cww
Copy link

cww commented Mar 28, 2014

For what it's worth, I've hit this problem, as well. I also tried Data::UUID against UUID::Tiny, and my investigation found the same results as @ethandbrown's. Notably:

$ perl -MData::UUID -E 'print Data::UUID->new()->from_string("1e04e695-68ef-45fa-ba61-800b044f66c2")' | xxd
0000000: 95e6 041e ef68 fa45 ba61 800b 044f 66c2  .....h.E.a...Of.

This is with version 1.219 of Data::UUID supplied by Debian x64's libdata-uuid-perl package.

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