Thanks for all your comments!
I went through each, and this is what met my requirement best:
What I needed was just time-based UUIDs that were generated from random numbers once for each user who installed the application. The version of UUID 4, as specified in RFC 4122, was just that. I reviewed the proposed algorithm and came up with a fairly simple solution that will work on both Linux and Windows (perhaps too simplistic, but it satisfies the need!):
srand(time(NULL)); sprintf(strUuid, "%x%x-%x-%x-%x-%x%x%x", rand(), rand(), // Generates a 64-bit Hex number rand(), // Generates a 32-bit Hex number ((rand() & 0x0fff) | 0x4000), // Generates a 32-bit Hex number of the form 4xxx (4 indicates the UUID version) rand() % 0x3fff + 0x8000, // Generates a 32-bit Hex number in the range [0x8000, 0xbfff] rand(), rand(), rand()); // Generates a 96-bit Hex number
themoondothshine
source share