[ion] Add Ion::crc32

Takes only 32bit values. Uses non-reversed data/input

Change-Id: I8a776064af69047f7a8fa1399cf8a484f42b9b18
This commit is contained in:
Romain Goyet
2017-01-06 17:22:29 +01:00
parent c1db79b5f9
commit 025405d01d
8 changed files with 89 additions and 0 deletions

10
ion/test/crc32.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include <quiz.h>
#include <ion.h>
#include <assert.h>
QUIZ_CASE(ion_crc32) {
uint32_t input[] = { 0x48656C6C, 0x6F2C2077 };
assert(Ion::crc32(input, 1) == 0x93591FFD);
assert(Ion::crc32(input, 2) == 0x72EAD3FB);
}