urbit/pkg/ent/test.c
Benjamin Summers 9618f37965 Add 'pkg/ent/' from commit '31ac2913f14c6f7631f5792ad942605fb2d9fb87'
git-subtree-dir: pkg/ent
git-subtree-mainline: 1207c204cb
git-subtree-split: 31ac2913f1
2019-03-04 16:49:14 -08:00

21 lines
324 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ent.h"
int main(void) {
char buf[256] = {0};
if (0 != ent_getentropy(buf, sizeof(buf))) {
perror("getentropy");
exit(1);
}
for (int i = 0; i < sizeof buf; i++) {
printf("%02hhx", buf[i]);
}
puts("");
}