Skip to content

Instantly share code, notes, and snippets.

@alanduan
Created August 14, 2016 04:15
Show Gist options
  • Save alanduan/5b59be7640892413cd3072fa294f388d to your computer and use it in GitHub Desktop.
Save alanduan/5b59be7640892413cd3072fa294f388d to your computer and use it in GitHub Desktop.
extern uint32_t crc32_table[];
uint32_t
crc32(uint8_t *buf, size_t count, uint32_t crc)
{
while (count--)
crc = crc32_table[(crc32 ^ *buf++) & 0xff] ^ crc32 >> 8;
return crc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment