Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-06-04 13:43:41


Andy wrote:

> 4. Use the current seed as the random numbers directly. Will this
> solution provide 'good' uuids? That is, is this source of random
> numbers good enough?

You'll need to perform statistical tests to be sure, but:

1. On POSIX systems where /dev/urandom is available, it should be close to
the best, at least in theory;

2. Under a typical use case where the application only generates one UUID,
it should be as good as any other RNG seeded with its entire state, and
should be better than a RNG seeded with a 32 bit seed;

3. In the multiple UUIDs case, I expect it to be competitive with any RNG,
even though it only keeps 160 bits of state (another 160 bits - the old
value of 'rd' - can also contribute, depending on the compiler and the use
pattern).


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