MCPcopy Create free account
hub / github.com/defold/defold / CRC16ForByte

Function CRC16ForByte

engine/hid/src/test/test_hid.cpp:331–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331static uint16_t CRC16ForByte(uint8_t value)
332{
333 uint16_t crc = 0;
334 for (uint32_t i = 0; i < 8; ++i)
335 {
336 crc = (uint16_t) ((((crc ^ value) & 1) ? 0xA001 : 0) ^ (crc >> 1));
337 value >>= 1;
338 }
339 return crc;
340}
341
342static uint16_t UpdateCRC16(uint16_t crc, const char* string)
343{

Callers 1

UpdateCRC16Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected