// // Created by titov on 26.11.2021. // #ifndef UMLIBRARY_DEV_CRCPOLYS_HH #define UMLIBRARY_DEV_CRCPOLYS_HH #include "Crc.hpp" namespace common { namespace crc { struct CrcPolynoms { enum Types { Crc3_GSM, Crc6_BISS, }; typedef uint16_t (* Crc16Poly)(const char * data, std::size_t bytes_size); typedef uint32_t (* Crc32Poly)(const char * data, std::size_t bytes_size); struct CrcInstance { union CrcPoly { Crc16Poly crc16 = nullptr; Crc32Poly crc32; } poly; uint16_t bit_size = 0; }; static CrcInstance instanse( Types type ); }; } } #endif //UMLIBRARY_DEV_CRCPOLYS_HH