[Development] QUuid documentation

Matthew Woehlke mwoehlke.floss at gmail.com
Thu Sep 22 23:15:36 CEST 2016

On 2016-09-08 05:35, Benjamin TERRIER wrote:
> 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.

There are three types. The first is "unique" (unqualified). The second
"can't be guaranteed to be unique" (and while not stated explicitly,
"probably won't be under particular, easily obtained circumstances" is
implied). The third "almost certainly will be unique".

You are lumping the second and third into "not unique", which is a
little strange given the difference in degree of "probably unique" that
applies, which I think is throwing people off. However, I take your
point that probably the first should have the same "almost certainly"
qualification as the third, vs. the apparently unqualified "will be"
assertion it has presently. FWIW, that seems to me like a reasonable
change to request. (If nothing else, the first and third are AFAIK
equally likely to either be or not be unique, so phrasing them similarly
makes sense.)


More information about the Development mailing list