def crc(inbytes):
    """Calculates the ISO-14443A CRC checksum"""
    wCrc = 0x6363

    for i in range(len(inbytes)):
        byte = ord(inbytes[i])
        byte = (byte ^ (wCrc & 0x00FF))
        byte = ((byte ^ (byte << 4)) & 0xFF)
        wCrc = ((wCrc >> 8) ^ (byte << 8) ^ (byte << 3) ^ (byte >> 4)) & 0xFFFF

    res = chr(wCrc & 0xFF) + chr((wCrc >> 8) & 0xff)
    return res