urandom
uses the same entropy pool that random
does, and if there is enough entropy in the pool at the moment you call it, it returns the same kinds of results that random
would.
However, you might be surprised at just how big of an if that can be, and it's not something that you have any direct control over. Most computers are not equipped with hardware that constantly gathers any kind of reliable entropy, and gathering enough of it from non-constant but reliable sources can take a while. When there isn't enough, urandom
falls back on a PRNG, with all the problems (including predictability) that go with it.
For a lot of applications -most games, for example- that's still good enough. But there are important applications where it isn't, and I assure you, your machine does use those applications behind the scenes even if you don't consciously see/use them. For that reason, it's not a good idea to just use urandom
everywhere.
Out of curiosity, what makes you think random
is so slow? Where is your computer locking up?
1On Linux, both /dev/random and /dev/urandom use the same CSPRNG at all times. – Viktor Dahl – 2016-01-20T19:39:59.213