3 ms·
> `OsRng` in the rand crate (go ahead, try to write a function that safely reads urandom in C). Nowadays, you should just call getentropy (http://man7.org/linu
by cesarb 9y ago
> `OsRng` in the rand crate (go ahead, try to write a function that safely reads urandom in C).
Nowadays, you should just call getentropy (http://man7.org/linux/man-pages/man3/getentropy.3.html http://man7.org/linux/man-pages/man3/getentropy.3.html) instead of trying to read from /dev/urandom, unless you have special requirements.
- dbaupp 9y agoGreat example! OsRng will use that system call, if it is available.