This is the algorithm that most people use but it isn't ideal.  Please have a look at the code here: https://github.com/zackw/stegotorus/blob/master/src/rng.cc#L86 and the paper at http://allendowney.com/research/rand/ .