Boost logo

Boost :

Subject: Re: [boost] [uuid] basic_random_generator doesn't produce a fullyrandomized uuid when sizeof(unsigned long) == 4
From: Andy Tompkins (atompkins_at_[hidden])
Date: 2010-03-03 12:14:39


On Tue, 02 Mar 2010 16:05 +0000, "Sylvester-Bradley, Gareth"
<Gareth.Sylvester-Bradley_at_[hidden]> wrote:
> > This is definitely a mistake, since it means only about 4 billion
> > 'til a collision, completely destroying the utility of random UUIDs.
> > Not to mention that shifting by >= the width isn't well-defined,
> > which means there's no guarantee it even gives different UUIDs.
>
> Right.
>
> > Good catch.

Absolutely great catch! It is definitely a mistake.

>
> Simplest patch could be just:
>
> 370a370
> > i=0;

This is exactly what I meant it to be. Reset i every time it equals
sizeof(unsigned long).

Just to double check, I fix this in trunk and wait to put it into
release until it is open for these changes. Correct?

>
> Best regards,
> Gareth

Thanks very much!
Andy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk