1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-12 08:12:22 +01:00

Move crc16 to helpers (#3780)

This commit is contained in:
Jesse Hills
2022-09-06 12:57:21 +12:00
committed by GitHub
parent 614eb81ad7
commit c317422ed7
7 changed files with 23 additions and 58 deletions

View File

@@ -149,6 +149,9 @@ template<typename T, typename U> T remap(U value, U min, U max, T min_out, T max
/// Calculate a CRC-8 checksum of \p data with size \p len.
uint8_t crc8(uint8_t *data, uint8_t len);
/// Calculate a CRC-16 checksum of \p data with size \p len.
uint16_t crc16(const uint8_t *data, uint8_t len);
/// Calculate a FNV-1 hash of \p str.
uint32_t fnv1_hash(const std::string &str);