Algorithm for generating a unique ID in C++?

前端 未结 6 1435
走了就别回头了
走了就别回头了 2021-02-02 07:50

What can be the best algorithm to generate a unique id in C++? The length ID should be a 32 bit unsigned integer.

6条回答
  •  清歌不尽
    2021-02-02 08:29

    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.

提交回复
热议问题