We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ba6589 commit 1feab84Copy full SHA for 1feab84
Sources/UUID/uuid.c
@@ -88,6 +88,12 @@ static inline void read_random(void *buffer, unsigned numBytes) {
88
BCryptGenRandom(NULL, buffer, numBytes,
89
BCRYPT_RNG_USE_ENTROPY_IN_BUFFER | BCRYPT_USE_SYSTEM_PREFERRED_RNG);
90
}
91
+#elif TARGET_OS_WASI
92
+#include <sys/random.h>
93
+
94
+static inline void read_random(void *buffer, unsigned numBytes) {
95
+ getentropy(buffer, numBytes);
96
+}
97
#else
98
static inline void read_random(void *buffer, unsigned numBytes) {
99
int fd = open("/dev/urandom", O_RDONLY);
0 commit comments