src/services/checksum.hpp
BeforeProposed
+1−1
55 for (auto byte : bytes) {
66 crc ^= static_cast<std::uint16_t>(byte) << 8;
77 for (int bit = 0; bit < 8; bit++) {
8 crc = static_cast<std::uint16_t>((crc & 0x8000) ? (crc << 1) ^ 0x8005 : crc << 1);
8 crc = static_cast<std::uint16_t>((crc & 0x8000) ? (crc << 1) ^ 0x1021 : crc << 1);
99 }
1010 }
1111 return crc;