diff options
author | Leah Neukirchen <leah@vuxu.org> | 2024-10-02 18:38:26 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2024-10-02 18:38:26 +0200 |
commit | b47ca7881db8807e7601bcdecb9b61294a186810 (patch) | |
tree | 43683d9d198ef8253d11343868efc10c0659f999 /ulid.c | |
parent | 945bc437108bd0bec6ffbd4e62d2eb5a4e7ba941 (diff) | |
download | ulidgen-master.tar.gz ulidgen-master.tar.xz ulidgen-master.zip |
Diffstat (limited to 'ulid.c')
-rw-r--r-- | ulid.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ulid.c b/ulid.c index dde7add..06d2eb6 100644 --- a/ulid.c +++ b/ulid.c @@ -7,12 +7,11 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -#include <sys/random.h> - #include <stdint.h> #include <stdlib.h> #include <string.h> #include <time.h> +#include <unistd.h> void ulidgen_r(char ulid[27]) @@ -53,7 +52,7 @@ ulidgen_r(char ulid[27]) } unsigned char rnd[16]; /* use 16 bytes for easier encoding */ - if (getrandom(rnd, sizeof rnd, 0) < 0) + if (getentropy(rnd, sizeof rnd) < 0) abort(); for (int i = 0; i < 16; i++) |