17 memset(buf, 0,
sizeof(buf));
20 memset(buf, 0xff,
sizeof(buf));
23 for (
int i = 0; i < 32; i++) {
28 for (
int i = 0; i < 32; i++) {
33 unsigned char data[48] = {
34 0x01, 0xc0, 0x00, 0x00,
35 0x00, 0x00, 0x00, 0x00,
36 0x00, 0x00, 0x00, 0x00,
37 0x00, 0x00, 0x00, 0x00,
38 0x14, 0x00, 0x00, 0x00,
39 0x00, 0x00, 0x04, 0x00,
40 0x00, 0x00, 0x00, 0x14,
41 0x00, 0x00, 0x00, 0x18,
42 0x28, 0x00, 0x00, 0x00,
43 0x00, 0x00, 0x00, 0x00,
44 0x02, 0x00, 0x00, 0x00,
45 0x00, 0x00, 0x00, 0x00,
47 ASSERT_EQ(0xd9963a56,
Value(reinterpret_cast<char*>(data),
sizeof(data)));
70 int main(
int argc,
char** argv) {
uint32_t Unmask(uint32_t masked_crc)
uint32_t Mask(uint32_t crc)
int main(int argc, char **argv)
TEST(CRC, StandardResults)
uint32_t Value(const char *data, size_t n)
uint32_t Extend(uint32_t crc, const char *buf, size_t size)