Loading...
Searching...
No Matches
nanovdb::crc32 Namespace Reference

## Functions

__hostdev__ void | initLut (uint32_t lut[256], uint32_t n)
| Initiate single entry in look-up-table for CRC32 computations.
__hostdev__ void | initLut (uint32_t lut[256])
| Initiate entire look-up-table for CRC32 computations.
std::unique_ptr< uint32_t[]> | createLut ()
| Create and initiate entire look-up-table for CRC32 computations.
__hostdev__ uint32_t | checksum (const void *data, size_t size, uint32_t crc=0)
| Compute crc32 checksum of `data` of `size` bytes (without a lookup table))
__hostdev__ uint32_t | checksum (const void *begin, const void *end, uint32_t crc=0)
| Compute crc32 checksum of data between `begin` and `end`.
__hostdev__ uint32_t | checksum (const void *data, size_t size, const uint32_t lut[256], uint32_t crc=0)
| Compute crc32 checksum of `data` with `size` bytes using a lookup table.
__hostdev__ uint32_t | checksum (const void *begin, const void *end, const uint32_t lut[256], uint32_t crc=0)
| Compute crc32 checksum of data between `begin` and `end` using a lookup table.

## Function Documentation

## checksum() [1/4]

__hostdev__ uint32_t checksum | ( | const void * | begin,
|  | const void * | end,
|  | const uint32_t | lut[256],
|  | uint32_t | crc = 0 )

inline

Compute crc32 checksum of data between `begin` and `end` using a lookup table.

Parameters

  begin | points to beginning of data
  end | points to end of @data, (exclusive)
  lut | pointer to loopup table for accelerated crc32 computation
  crc | initial value of crc32 checksum

Returns
  return crc32 checksum

## checksum() [2/4]

__hostdev__ uint32_t checksum | ( | const void * | begin,
|  | const void * | end,
|  | uint32_t | crc = 0 )

inline

Compute crc32 checksum of data between `begin` and `end`.

Parameters

  begin | points to beginning of data
  end | points to end of @data, (exclusive)
  crc | initial value of crc32 checksum

Returns
  return crc32 checksum

## checksum() [3/4]

__hostdev__ uint32_t checksum | ( | const void * | data,
|  | size_t | size,
|  | const uint32_t | lut[256],
|  | uint32_t | crc = 0 )

inline

Compute crc32 checksum of `data` with `size` bytes using a lookup table.

Parameters

  data | pointer to begenning of data
  size | byte size
  lut | pointer to loopup table for accelerated crc32 computation
  crc | initial value of the checksum

Returns
  crc32 checksum of `data` with `size` bytes

## checksum() [4/4]

__hostdev__ uint32_t checksum | ( | const void * | data,
|  | size_t | size,
|  | uint32_t | crc = 0 )

inline

Compute crc32 checksum of `data` of `size` bytes (without a lookup table))

Parameters

  data | pointer to beginning of data
  size | byte size of data
  crc | initial value of crc32 checksum

Returns
  return crc32 checksum of `data`

## createLut()

std::unique_ptr< uint32_t[]> createLut | ( |  | ) |

inline

Create and initiate entire look-up-table for CRC32 computations.

Returns
  returns a unique pointer to the lookup table of size 256.

## initLut() [1/2]

__hostdev__ void initLut | ( | uint32_t | lut[256] | ) |

inline

Initiate entire look-up-table for CRC32 computations.

Parameters

  lut | pointer of size 256 for look-up-table

## initLut() [2/2]

__hostdev__ void initLut | ( | uint32_t | lut[256],
|  | uint32_t | n )

inline

Initiate single entry in look-up-table for CRC32 computations.

Parameters

  lut | pointer of size 256 for look-up-table
  n | entry in table (assumed n < 256)