0

I want to generate UUID on a Windows Phone 8 device.

I have used DeviceExtendedProperties to get DeviceUniqueId, which returns a 20 byte array of numbers.

Then I have truncated it to 16 bytes (as in RFC4122 implementation example) and inserted variant (binary 10) and version number (5).

Finally, I initialized System.Guid object, passing my byte array into its constructor. The resulting string representation of System.Guid object is "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx", where M is version (4 bits set to 0 1 0 1) and N is a variant (4 bit number where two most significant bits are set to 1 0).

Is it okay to simply truncate the last 4 bytes from DeviceUniqueId? Do I really need to insert variant and version number? If so, which version number should I use or does it matter which version to use?

Community
  • 1
  • 1
Alex
  • 1,574
  • 17
  • 36
  • http://stackoverflow.com/questions/16893746/udid-for-windows-8 – Farhan Ghumra Sep 04 '14 at 10:31
  • Thanks for your comment @Xyroid, but the page you provided doesn't seem to answer any of my questions. They are talking about getting UUID on Windows 8, not WP8. Also they don't talk anything about format/version/variant of UUID. – Alex Sep 04 '14 at 11:07

0 Answers0