mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[ion/crc32] crc32Byte and crc32Word
This commit is contained in:
@@ -3,8 +3,13 @@
|
||||
#include <assert.h>
|
||||
|
||||
QUIZ_CASE(ion_crc32) {
|
||||
uint32_t input[] = { 0x48656C6C, 0x6F2C2077 };
|
||||
quiz_assert(Ion::crc32(input, 1) == 0x93591FFD);
|
||||
quiz_assert(Ion::crc32(input, 2) == 0x72EAD3FB);
|
||||
}
|
||||
uint32_t inputWord[] = { 0x48656C6C, 0x6F2C2077 };
|
||||
quiz_assert(Ion::crc32Word(inputWord, 1) == 0x93591FFD);
|
||||
quiz_assert(Ion::crc32Word(inputWord, 2) == 0x72EAD3FB);
|
||||
|
||||
uint8_t inputBytes[] = {0x6C, 0x6C, 0x65, 0x48, 0x77, 0x20, 0x2C, 0x6F};
|
||||
quiz_assert(Ion::crc32Byte(inputBytes, 1) == 0xD7A1E247);
|
||||
quiz_assert(Ion::crc32Byte(inputBytes, 4) == 0x93591FFD);
|
||||
quiz_assert(Ion::crc32Byte(inputBytes, 6) == 0x7BCD4EB3);
|
||||
quiz_assert(Ion::crc32Byte(inputBytes, 8) == 0x72EAD3FB);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user