summaryrefslogtreecommitdiff
path: root/prototype/fw/src/crc32_test.c
blob: e23bb37d6adf59dff441fa19691f4640d5e5d525 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>

#include "crc32.h"

int main(void) {
	crc32_t state = crc32_reset();

	do {
		char c;
		if (fread(&c, 1, 1, stdin) != 1)
			break;

		state = crc32_update(state, (uint8_t)c);
	} while(23);

	state = crc32_finalize(state);
	printf("%08x\n", state);
	return 0;
}