SHARE
TWEET

Untitled

a guest Jun 27th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unsigned short crc16 (const void *data, unsigned data_size)
  2. {
  3.  if (!data || !data_size)
  4.  return 0;
  5.  unsigned short crc = 0;
  6.  unsigned char* buf = (unsigned char*)data;
  7.  while (data_size--)
  8.  crc = (crc >> 8) ^ crc16_table[(unsigned char)crc ^ *buf++];
  9.  return crc;
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top