XrdOucCRC Class Reference

#include <XrdOucCRC.hh>

List of all members.

Public Member Functions

 XrdOucCRC ()
 ~XrdOucCRC ()

Static Public Member Functions

static uint32_t CRC32 (const unsigned char *data, int count)
static uint32_t Calc32C (const void *data, size_t count, uint32_t prevcs=0)
static void Calc32C (const void *data, size_t count, uint32_t *csval)
static bool Ver32C (const void *data, size_t count, const uint32_t csval, uint32_t *csbad=0)
static int Ver32C (const void *data, size_t count, const uint32_t *csval, uint32_t &valcs)
static bool Ver32C (const void *data, size_t count, const uint32_t *csval, bool *valok)
static bool Ver32C (const void *data, size_t count, const uint32_t *csval, uint32_t *valcs)

Static Private Attributes

static unsigned int crctable [256]

Constructor & Destructor Documentation

XrdOucCRC::XrdOucCRC (  )  [inline]
XrdOucCRC::~XrdOucCRC (  )  [inline]

Member Function Documentation

static void XrdOucCRC::Calc32C ( const void *  data,
size_t  count,
uint32_t *  csval 
) [static]

Compute a CRC32C page checksums using hardware assist if available.

Parameters:
data Pointer to the data whose checksum it to be computed.
count The number of bytes pointed to by data.
csval Pointer to a vector to hold individual page checksums. The vector must be sized: (count/XrdSysPageSize + (countXrdSysPageSize != 0)).
Returns:
Each element of csval holds the checksum for the associated page.
static uint32_t XrdOucCRC::Calc32C ( const void *  data,
size_t  count,
uint32_t  prevcs = 0 
) [static]

Compute a CRC32C checksum using hardware assist if available.

Parameters:
data Pointer to the data whose checksum it to be computed.
count The number of bytes pointed to by data.
prevcs The previous checksum value. The initial checksum of checksum sequence should be zero, the default.
Returns:
The CRC32C checksum.
static uint32_t XrdOucCRC::CRC32 ( const unsigned char *  data,
int  count 
) [static]

Compute a CRC32 checksum.

Note:
This is a historical method as it uses the very slow CRC32 algoritm.
Parameters:
data Pointer to the data whose checksum it to be computed.
count The number of bytes pointed to by data.
Returns:
The CRC32 checksum.

Referenced by XrdOfsHanKey::XrdOfsHanKey().

static bool XrdOucCRC::Ver32C ( const void *  data,
size_t  count,
const uint32_t *  csval,
uint32_t *  valcs 
) [static]

Verify a CRC32C page checksums using hardware assist if available.

Parameters:
data Pointer to the data whose checksum it to be verified.
count The number of bytes pointed to by data.
csval Pointer to a vector of expected page checksums. The vector must be sized (count/PageSize+(countPageSize != 0)).
valcs Pointer to a vector of the same size as csval to hold the computed checksum.
Returns:
True if all the checksums match; false otherwise.
static bool XrdOucCRC::Ver32C ( const void *  data,
size_t  count,
const uint32_t *  csval,
bool *  valok 
) [static]

Verify a CRC32C page checksums using hardware assist if available.

Parameters:
data Pointer to the data whose checksum it to be verified.
count The number of bytes pointed to by data.
csval Pointer to a vector of expected page checksums. The vector must be sized (count/PageSize+(countPageSize != 0)).
valok Pointer to a vector of the same size as csval to hold the results of the comparison (true matches, o/w false).
pgsz The length in bytes of each page.
Returns:
True if all the checksums match with each element of valok set to true. Otherwise, false is returned and false is set in valok for each page that did not match the expected checksum.
static int XrdOucCRC::Ver32C ( const void *  data,
size_t  count,
const uint32_t *  csval,
uint32_t &  valcs 
) [static]

Verify a CRC32C page checksums using hardware assist if available.

Parameters:
data Pointer to the data whose checksum it to be verified.
count The number of bytes pointed to by data.
csval Pointer to a vector of expected page checksums. The vector must be sized: (count/XrdSysPageSize + (countXrdSysPageSize != 0)).
valcs Where the computed checksum is returned for the page whose verification failed; otherwise it is untouched.
Returns:
-1 if all the checksums match. Otherwise, the non-negative index into csval whose checksum does not match.
static bool XrdOucCRC::Ver32C ( const void *  data,
size_t  count,
const uint32_t  csval,
uint32_t *  csbad = 0 
) [static]

Verify a CRC32C checksum using hardware assist if available.

Parameters:
data Pointer to the data whose checksum it to be verified.
count The number of bytes pointed to by data.
csval The expected checksum.
csbad If csbad is not nil, the computed checksum is returned.
Returns:
True if the expected checksum equals the actual checksum; otherwise, false is returned.

Member Data Documentation

unsigned int XrdOucCRC::crctable[256] [static, private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1