"""Common codec utility tests.""" import struct from go1_pro_sdk.utils.common import gen_crc def _gen_crc_bitwise(data: bytes) -> bytes: crc = 0xFFFFFFFF for (word,) in struct.iter_unpack("> 31) & 1 crc <<= 1 crc &= 0xFFFFFFFF if x ^ (1 & (word >> (31 - bit))): crc ^= 0x04c11db7 return struct.pack("