Reputation: 119
In standard c++, how to generate GUID?
In windows, I know I have API to create. But I would like to be platform independent, is there a way?
Upvotes: 2
Views: 1719
Reputation: 73376
The GUID refers to Microsoft's implementation of the Universal Unique IDentifier (UUID) defined by RFC 4122.
So for the Microsoft implementation there is no portable way to generate it: it's windows API. It's 16 bytes as UUID, but there are some differences in the byte order.
But if you are looking for UUID, boost provides a portable implementation.
Upvotes: 2