Getting a unique id from a unix-like system

前端 未结 15 2474
不知归路
不知归路 2020-11-27 18:22

I want to get from any Unix-like system (if this is possible) a unique id that will be persistent every time my application runs in the same machine. If it is possible, I wa

15条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 19:13

    Sounds like you are looking for UUID. This is a common universally unique id (really, the same thing as a GUID)

    There are many C++ implementations of this in diffrent libs, or you could use the uuidgen command and capture the output.

提交回复
热议问题