2 ms·
arc4random (under a different name as the name is misleading) will be standardised, and Linux now has a random() syscall that is a necessary building block, so
by justincormack 12y ago
arc4random (under a different name as the name is misleading) will be standardised, and Linux now has a random() syscall that is a necessary building block, so it doesnt fail.
In the meantime, use arc4random on openbsd and netbsd 7 and read from /dev/urandom on all other platforms (FreeBSD is in process of fixing arc4random, currently still uses rc4 and may have problems with state being same in multiple threads; I guess OSX is the same version).
Android does have arc4random, although it can fall back to weaker random sources if it does not manage to open /dev/urandom https://code.google.com/p/android-source-browsing/source/browse/libc/bionic/arc4random.c?repo=platform--bionic&r=3a654b1e04d4275ae315cfe1b196998acf10052c https://code.google.com/p/android-source-browsing/source/bro...