#include <XrdOucCRC.hh>
|
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) |
|
◆ XrdOucCRC()
◆ ~XrdOucCRC()
XrdOucCRC::~XrdOucCRC |
( |
| ) |
|
|
inline |
◆ Calc32C() [1/2]
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/XrdSys::PageSize + (countXrdSys::PageSize != 0)). On return, each element of csval holds the checksum for the associated page. |
◆ Calc32C() [2/2]
static uint32_t XrdOucCRC::Calc32C |
( |
const void * |
data, |
|
|
size_t |
count, |
|
|
uint32_t |
prevcs = 0 |
|
) |
| |
|
static |
◆ CRC32()
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().
◆ Ver32C() [1/4]
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). |
- 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.
◆ Ver32C() [2/4]
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/XrdSys::PageSize + (countXrdSys::PageSize != 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.
◆ Ver32C() [3/4]
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.
◆ Ver32C() [4/4]
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.
◆ crctable
unsigned int XrdOucCRC::crctable[256] |
|
staticprivate |
The documentation for this class was generated from the following file: