The class for calculating the CRC-32 for data (streams).
More...
#include "nn/nlib/Crc.h"
The class for calculating the CRC-32 for data (streams).
- Description
- There are many ways to calculate CRC-32, but this class uses the same methods as RFC 2083 (PNG) and RFC 1952 (gzip).
Crc32 c;
const char str[] = "This is a string";
c.Update(&str[0], std::strlen(str));
c.GetValue();
Definition at line 10 of file Crc.h.
nn::nlib::Crc32::GetValue |
( |
| ) |
const |
|
noexcept |
Returns a CRC-32 value.
- Returns
- A CRC-32 value.
nn::nlib::Crc32::Update |
( |
const void * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
noexcept |
Updates the checksum with data located in the given region.
- Parameters
-
[in] | buf | The memory region to use for updating the checksum. |
[in] | len | The size of the memory region. |
- Returns
- The function may return
ENOMEM
only when it is executed for the first time.
nn::nlib::Crc32::Update |
( |
int |
b | ) |
|
|
noexcept |
Updates the checksum with one byte of data.
- Parameters
-
[in] | b | The byte data to use for updating the checksum. |
- Returns
- The function may return
ENOMEM
only when it is executed for the first time.
The documentation for this class was generated from the following files: