[Development] QUuid documentation

Benjamin TERRIER b.terrier at gmail.com
Thu Sep 8 11:35:22 CEST 2016


Hi,

As of Qt 5.7, QUuid::createUuid() documentation is:

> On any platform other than Windows, this function returns a new UUID with variant QUuid::DCE and version QUuid::Random. If the /dev/urandom device exists, then the numbers used to construct the UUID will be of cryptographic quality, which will make the UUID unique. Otherwise, the numbers of the UUID will be obtained from the local pseudo-random number generator (qrand(), which is seeded by qsrand()) which is usually not of cryptograhic quality, which means that the UUID can't be guaranteed to be unique.
>
> On a Windows platform, a GUID is generated, which almost certainly will be unique, on this or any other system, networked or not.

So according to this there are 3 kinds of UUID:
- Generated by /dev/urandom
- Generated by qrand()
- Generated on Windows OS

The documentation states explicitly that the first type is unique and
that the 2 last types are not unique.

However, my knowledge is that whatever the method one use to generate
your UUID, one can never guarantee its uniqueness. Meaning that the Qt
documentation is falsely guarantying unique UUID and therefore should
be changed.

If anyone can confirm, I'll create a bug report.

BR,

Benjamin Terrier



More information about the Development mailing list