/* * Copyright (c) 2019 - 2021 Stefan Strobel * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** * @file shellmatta_crc.h * @brief cyclic redundancy check functions of shellmatta * @author Simon Fischer */ #ifndef _SHELLMATTA_CRC_H_ #define _SHELLMATTA_CRC_H_ #include #define CRC32_POLYNOM 0x04c11db7u /**< crc-32 ethernet 802.3 */ #define CRC16_XMODEM_POLYNOM 0x1021u /**< crc16 xmodem */ #define BITS_PER_BYTE ((uint8_t)8) /**< amount of bits per byte; to avoid magic number */ uint32_t crc32Calc(const char* data, uint32_t size); uint16_t crc16Calc(const char* data, uint32_t size); #endif /* _SHELLMATTA_CRC_H_ */