Skip to content

Instantly share code, notes, and snippets.

@dsprenkels
Created May 11, 2017 09:14
Show Gist options
  • Save dsprenkels/36171c2def70636927784985dbb276ff to your computer and use it in GitHub Desktop.
Save dsprenkels/36171c2def70636927784985dbb276ff to your computer and use it in GitHub Desktop.
#include "randombytes.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
const size_t size = 1024*1024;
char *buf;
size_t idx;
buf = calloc(size, sizeof(char));
randombytes(buf, size);
for (idx = 0; idx < size; idx++) printf("%02hhx", buf[idx]);
printf("\n");
free(buf);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment