ryanking/simple_uuid — pull request #12 by mastahyeti (2013-05-14 22:05:14+00:00)
Title: SecureRandom

`Random::rand` is a PRNG based on the Mersenne Twister (MT) algorithm. MT generates results that *look* very random, but it is relatively easy to [clone the internal state of the generator]( http://crypto.di.uoa.gr/CRYPTO.SEC/Randomness_Attacks_files/paper.pdf). This PR switches from `Random::rand` to `SecureRandom::random_number`, which backends to OpenSSL.

I know `SimpleUUID` doesn't make any promises about the quality of its randomness. Also, I know that type 4 UUIDs are generally used when randomness is desirable. That being said, it seems like better randomness is preferable. We are using this gem and are in a situation where we appreciate the fact that type 1 UUIDs give insights into time (unlike type 4), but would still like some randomness if possible.