MySQL 8.0.39
Source Code Documentation
|
CRC32 implementation. More...
#include "univ.i"
Go to the source code of this file.
Macros | |
#define | CRC32_DEFAULT |
Typedefs | |
typedef uint32_t(* | ut_crc32_func_t) (const byte *ptr, size_t len) |
Calculates CRC32. More... | |
Functions | |
void | ut_crc32_init () |
Initializes the data structures used by ut_crc32*(). More... | |
uint32_t | ut_crc32_legacy_big_endian (const byte *buf, size_t len) |
Calculates CRC32 using legacy algorithm, which uses big-endian byte ordering when converting byte sequence to integers - flips each full aligned 8-byte chunk within the buf, but not the initial and trailing unaligned fragments. More... | |
Variables | |
constexpr uint32_t | CRC32C_POLYNOMIAL {0x1EDC6F41} |
The CRC-32C polynomial without the implicit highest 1 at x^32. More... | |
ut_crc32_func_t | ut_crc32 |
Pointer to standard-compliant CRC32-C (using the GF(2) primitive polynomial 0x11EDC6F41) calculation function picked by ut_crc32_init() as the fastest implementation for the current environment. More... | |
bool | ut_crc32_cpu_enabled |
Flag that tells whether the CPU supports CRC32 or not. More... | |
bool | ut_poly_mul_cpu_enabled |
Flag that tells whether the CPU supports polynomial multiplication or not. More... | |
CRC32 implementation.
Created Aug 10, 2011 Vasil Dimov
#define CRC32_DEFAULT |
typedef uint32_t(* ut_crc32_func_t) (const byte *ptr, size_t len) |
Calculates CRC32.
ptr | - data over which to calculate CRC32. |
len | - data length in bytes. |
void ut_crc32_init | ( | ) |
Initializes the data structures used by ut_crc32*().
Does not do any allocations, would not hurt if called twice, but would be pointless.
uint32_t ut_crc32_legacy_big_endian | ( | const byte * | buf, |
size_t | len | ||
) |
Calculates CRC32 using legacy algorithm, which uses big-endian byte ordering when converting byte sequence to integers - flips each full aligned 8-byte chunk within the buf, but not the initial and trailing unaligned fragments.
ut_crc32_init() needs to be called at least once before calling this function.
[in] | buf | data over which to calculate CRC32 |
[in] | len | data length |
|
constexpr |
The CRC-32C polynomial without the implicit highest 1 at x^32.
|
extern |
Pointer to standard-compliant CRC32-C (using the GF(2) primitive polynomial 0x11EDC6F41) calculation function picked by ut_crc32_init() as the fastest implementation for the current environment.
Pointer to standard-compliant CRC32-C (using the GF(2) primitive polynomial 0x11EDC6F41) calculation function picked by ut_crc32_init() as the fastest implementation for the current environment.
The code in this file is used to make a library for external tools. Pointer to CRC32 calculation function.
|
extern |
Flag that tells whether the CPU supports CRC32 or not.
|
extern |
Flag that tells whether the CPU supports polynomial multiplication or not.