fastrand.c 258 B

12345678910111213141516
  1. #include <u.h>
  2. #include <libc.h>
  3. #include <libsec.h>
  4. /*
  5. * use the X917 random number generator to create random
  6. * numbers (faster than truerand() but not as random).
  7. */
  8. ulong
  9. fastrand(void)
  10. {
  11. ulong x;
  12. genrandom((uchar*)&x, sizeof x);
  13. return x;
  14. }