4 ms·
Surely, you meant either "secure pseudorandom numbers" or "/dev/random".</pedantry>
by swolchok 17y ago
Surely, you meant either "secure pseudorandom numbers" or "/dev/random".</pedantry>
- there 17y agono, he meant /dev/urandom. /dev/random is reserved for hardware random generating devices on some operating systems (which may not return anything). /dev/urandom is a device that will always output pseudo random data without blocking when the entropy pool runs low.
- swolchok 17y agoYes, so /dev/urandom is not suitable if you want "secure random numbers", because its output may be pseudorandom.
- tptacek 17y agoWhat a weird little subthread. urandom and random are both CSPRNGs --- the same CSPRNG, in fact --- the only difference between them is whether the device blocks to fetch more entropy. Go ahead and use /dev/random if that question freaks you out. Either way, don't rely on mt_random.