File: gcrc64rfl.c

package info (click to toggle)
bglibs 2.04%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,368 kB
  • sloc: ansic: 15,820; perl: 674; sh: 64; makefile: 26
file content (10 lines) | stat: -rw-r--r-- 252 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
#include "gcrc.h"

uint64 gcrc64rfl(uint64 crc, const char* data, long len,
		 const uint64 table[256])
{
  const unsigned char* ptr = (const unsigned char*)data;
  while (len-- > 0)
    crc = table[(crc ^ *ptr++) & 0xff] ^ (crc >> 8);
  return crc;
}