| John Wang | d8702f6 | 2019-10-31 10:06:35 +0800 | [diff] [blame] | 1 | #ifndef UTILS_H__ |
| 2 | #define UTILS_H__ | ||||
| 3 | |||||
| 4 | #ifdef __cplusplus | ||||
| 5 | extern "C" { | ||||
| 6 | #endif | ||||
| 7 | |||||
| 8 | #include <stddef.h> | ||||
| 9 | #include <stdint.h> | ||||
| 10 | |||||
| 11 | /** @brief Compute Crc32(same as the one used by IEEE802.3) | ||||
| 12 | * | ||||
| 13 | * @param[in] data - Pointer to the target data | ||||
| 14 | * @param[in] size - Size of the data | ||||
| 15 | * @return The checksum | ||||
| 16 | */ | ||||
| 17 | uint32_t crc32(const void *data, size_t size); | ||||
| 18 | |||||
| 19 | #ifdef __cplusplus | ||||
| 20 | } | ||||
| 21 | #endif | ||||
| 22 | |||||
| 23 | #endif | ||||