Advertisement
homer512

Random device

Jan 19th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. /*
  2.  * Example showing the poor behavior of std::random_device on Linux with
  3.  * GCC 4.7.3
  4.  * Inspect the execution of this program with strace
  5.  * Note how much entropy is read (and wasted) from /dev/urandom
  6.  */
  7. #include <random>
  8.  
  9. int main()
  10. {
  11.   std::random_device dev;
  12.   return dev();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement