1 #ifndef __XRDCKSCALCCRC32_HH__
2 #define __XRDCKSCALCCRC32_HH__
34 #include <sys/types.h>
35 #include <netinet/in.h>
45 char *
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;
53 #ifndef Xrd_Big_Endian
54 TheResult = htonl(TheResult);
56 return (
char *)&TheResult;
59 void Init() {C32Result = CRC32_XINIT; TotLen = 0;}
63 void Update(
const char *Buff,
int BLen);
65 const char *
Type(
int &csSz) {csSz =
sizeof(TheResult);
return "crc32";}
71 static const unsigned int CRC32_XINIT = 0;
72 static const unsigned int CRC32_XOROT = 0xffffffff;
73 static 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()