jabberd14 1.6.2
Defines | Functions
crc32.cc File Reference

Implementation of CRC32 using precomputed remainders. More...

#include <jabberdlib.h>

Defines

#define CRC32_UPDATE(crc, nxt)   (crc = CRC32_TAB[(crc^(nxt))&0xff]^(crc >> 8))

Functions

void crc32_r (const char *str, char crc32buf[9])

Detailed Description

Implementation of CRC32 using precomputed remainders.


Define Documentation

#define CRC32_UPDATE (   crc,
  nxt 
)    (crc = CRC32_TAB[(crc^(nxt))&0xff]^(crc >> 8))

Referenced by crc32_r().


Function Documentation

void crc32_r ( const char *  str,
char  crc32buf[9] 
)

calculate a 32 bit CRC value with the polynom c(x) = 1+x+x^2+x^4+x^5+x^7+x^8+x^10+x^11+x^12+x^16+x^22+x^23+x^26+x^32 on a given string. We are initializing with zero and we are not inverting the result

Parameters:
strthe string for which we calculate the CRC
crc32bufwhere to put the result

References CRC32_UPDATE.

Referenced by _xdb_get_hashes().