2

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?

biluochun2010
  • 109
  • 1
  • 7

1 Answers1

2

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.

Community
  • 1
  • 1
Christophe
  • 68,716
  • 7
  • 72
  • 138