1#ifndef __XRDCKSCALCCRC32_HH__
2#define __XRDCKSCALCCRC32_HH__
35#include <netinet/in.h>
45char *
Final() {
char buff[
sizeof(
long long)];
46 long long tLcs = TotLen;
49 {
while(tLcs) {buff[i++] = tLcs & 0xff ; tLcs >>= 8;}
52 TheResult = C32Result ^ CRC32_XOROT;
54 TheResult = htonl(TheResult);
56 return (
char *)&TheResult;
59void Init() {C32Result = CRC32_XINIT; TotLen = 0;}
63void Update(
const char *Buff,
int BLen);
65const char *
Type(
int &csSz) {csSz =
sizeof(TheResult);
return "crc32";}
71static const unsigned int CRC32_XINIT = 0;
72static const unsigned int CRC32_XOROT = 0xffffffff;
73static unsigned int crctable[256];
74 unsigned int C32Result;
75 unsigned int TheResult;
void Update(const char *Buff, int BLen)
const char * Type(int &csSz)
virtual ~XrdCksCalccrc32()