def get_crc(msg):
register = <NUM_LIT><EOL>for byte_ in msg:<EOL><INDENT>try:<EOL><INDENT>val = struct.unpack('<STR_LIT>', byte_)[<NUM_LIT:0>]<EOL><DEDENT>except TypeError:<EOL><INDENT>val = byte_<EOL><DEDENT>register =(register >> <NUM_LIT:8>) ^ look_up_table[(register ^ val) & <NUM_LIT>]<EOL><DEDENT>return struct.pack('<STR_LIT>', register)<EOL>
Return CRC of 2 byte for message.

        >>> assert get_crc(b'\x02\x07') == struct.unpack('<H', b'\x41\x12')

    :param msg: A byte array.
    :return: Byte array of 2 bytes.