What is the best way to programmatically generate a GUID or UUID in C++ without relying on a platform-specific tool? I am trying to make unique identifiers for objects in a simulation, but can't rely on Microsoft's implementation as the project is cross-platform.
Notes:
- Since this is for a simulator, I
don't really need cryptographic
randomness. - It would be best if this is a 32 bit number.
Best Solution
If you can afford to use Boost, then there is a UUID library that should do the trick. It's very straightforward to use - check the documentation and this answer.