gendata.c
412 Bytes
#include <stdlib.h>
#include <stdio.h>
int
main(int argc, char* argv[]) {
int len, i;
unsigned short sum = 0;
if (argc != 2) {
fprintf(stderr, "Usage: gendata len\n");
return 1;
}
len = atoi(argv[1]);
srand(0xdeadbeaf);
for(i = 0; i < len*16*1024; i++) {
unsigned char c = rand()>>8;
sum += c;
fputc(c, stdout);
}
fprintf(stderr, "%04x\n", sum);
return 0;
}