File: gcrc32fwd.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-- 260 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
#include "gcrc.h"

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