-
-
Notifications
You must be signed in to change notification settings - Fork 879
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
Unexpected/incompatible byte representation #503
Comments
I now understand that [209, 151, 176, 117, 145, 184, 52, 72, 155, 18, 74, 148, 216, 196, 37, 4] is the mixed-endian encoded variant which I suppose is not supported by this package. |
@bjornharrtell wow, thanks for reporting! I think we should mention that in the documentation. Reference: https://stackoverflow.com/a/45671539/1053532 |
That's an interesting internal data structure MSFT is using to represent GUIDs. It's strange they use multi-byte ints for the first half of the bytes ( However in most other GUIDs (versions 4 most notably, but also 3 and 5), time fields don't exist so the distinction between time and non-time fields in such a data structure is not meaningful. Thus, I believe the structure we're using - a simple byte array with order that corresponds to the UUID string ordering - is better suited for most purposes. It's version and platform neutral, and generally more intuitive. (Put up a PR to explicitly document how bytes are ordered though.) |
I was confounded by this issue today. Not sure who's right here, but according to this SO answer the RFC states the |
I can roundtrip GUID
75b097d1-b891-4834-9b12-4a94d8c42504
with the following node repl code:But I suspect the byte representation is not as expected. I would expect the byte array to be [209, 151, 176, 117, 145, 184, 52, 72, 155, 18, 74, 148, 216, 196, 37, 4]. I found a gist at https://gist.github.com/daboxu/4f1dd0a254326ac2361f8e78f89e97ae that produces that array from
75b097d1-b891-4834-9b12-4a94d8c42504
and it's also what is produced by fx. C# / .NET.The text was updated successfully, but these errors were encountered: