def METHOD_NAME(b: bytes, crc32val: int = 0) -> int:
    """CRC32 algo from NuttX."""
    for b in bytearray(b):
        crc32val = CRC32_TAB[(crc32val ^ b) & 0xFF] ^ (crc32val >> 8)
    return crc32val