QuasarAppLib 1.0.530.c9fba11
crc32constexper.h File Reference
#include <array>
#include <cstddef>
#include <cstdint>
Include dependency graph for crc32constexper.h:

Go to the source code of this file.

Namespaces

namespace  QuasarAppUtils
 The QuasarAppUtils namespace contains the base functions for all applications of the QuasarApp group. All methods of the QuasarAppUtils classes are static.

Macros

#define LITIRAL_CRC32(str)
 LITIRAL_CRC32 This is a compile-time macro that calculates the crc32 hash of the string literal.

Functions

constexpr std::array< uint32_t, 256 > QuasarAppUtils::generateCrc32Table (uint32_t polynomial=0xEDB88320)
 generateCrc32Table This method generate crc32 table for fast calculate crc32 hash.
constexpr uint32_t QuasarAppUtils::calculateCrc32 (const char *data, size_t size, uint32_t initialCrc=0xFFFFFFFF)
 calculateCrc32 This method calculate crc32 hash for data.
constexpr uint16_t QuasarAppUtils::calculateCrc16 (const char *data, size_t size, uint32_t initialCrc=0xFFFFFFFF)
 calculateCrc16 This method calculate crc16 hash for data.
constexpr uint16_t QuasarAppUtils::calculateCrc8 (const char *data, size_t size, uint32_t initialCrc=0xFFFFFFFF)
 calculateCrc8 This method calculate crc8 hash for data.

Variables

constexpr std::array< uint32_t, 256 > QuasarAppUtils::crc32Table = generateCrc32Table()
 crc32Table This is crc32 table for fast calculate crc32 hash.

Macro Definition Documentation

◆ LITIRAL_CRC32

#define LITIRAL_CRC32 ( str)
Value:
(QuasarAppUtils::calculateCrc32(str, sizeof(str) - 1))
constexpr uint32_t calculateCrc32(const char *data, size_t size, uint32_t initialCrc=0xFFFFFFFF)
calculateCrc32 This method calculate crc32 hash for data.

LITIRAL_CRC32 This is a compile-time macro that calculates the crc32 hash of the string literal.

Parameters
strThis is the string literal that will be hashed.
Note
The trailing zero of the string literal is not included into the hash.

Definition at line 87 of file crc32constexper.h.