Boost logo

Boost :

Subject: Re: [boost] [uuid] basic_random_generator doesn't produce a fullyrandomized uuid when sizeof(unsigned long) == 4
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-03-03 14:15:30


Andy Tompkins wrote:
> 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?

Release branch is open for all changes at this point, so feel free to merge
this to release branch as soon as you see new test run on trunk, and everything
looks OK. You might want to update release notes, per website update
instructions, too.

- Volodya


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