def crc16(data):
m_crc = <NUM_LIT><EOL>for this in data:<EOL><INDENT>m_crc ^= ord(this)<EOL>for _ in range(<NUM_LIT:8>):<EOL><INDENT>j = m_crc & <NUM_LIT:1><EOL>m_crc >>= <NUM_LIT:1><EOL>if j:<EOL><INDENT>m_crc ^= <NUM_LIT><EOL><DEDENT><DEDENT><DEDENT>return m_crc<EOL>
Calculate an ISO13239 CRC checksum of the input buffer.