What can be the best algorithm to generate a unique id in C++? The length ID should be a 32 bit unsigned integer.
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.