renpy/module/libhydrogen/impl/random/wasi.h

13 lines
265 B
C
Raw Normal View History

2023-09-12 22:16:10 +00:00
#include <unistd.h>
static int
hydro_random_init(void)
{
if (getentropy(hydro_random_context.state, sizeof hydro_random_context.state) != 0) {
return -1;
}
hydro_random_context.counter = ~LOAD64_LE(hydro_random_context.state);
return 0;
}