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?