wasi.h 265 B

123456789101112
  1. #include <unistd.h>
  2. static int
  3. hydro_random_init(void)
  4. {
  5. if (getentropy(hydro_random_context.state, sizeof hydro_random_context.state) != 0) {
  6. return -1;
  7. }
  8. hydro_random_context.counter = ~LOAD64_LE(hydro_random_context.state);
  9. return 0;
  10. }