Hi, I think that Chema's routine is very random but I don't think it will provide you an uniform distribution.
I worked on it before, and i think you can find my posts on the forum. I'd made a routine with a call from OSDK C.

I used the following function. This function returns pseudo-random numbers that are power of 2. The argument n is used to define the upper limit of the returned values, the higher the n the lower the upper limit (e.g. for n=6 the function returns values 0, 1, 2 and 3).