def computeCRC(data):
 crc = 65535
 for a in data:
  idx = __crc16_table[((crc ^ ord(a)) & 255)]
  crc = (((crc >> 8) & 255) ^ idx)
 swapped = (((crc << 8) & 65280) | ((crc >> 8) & 255))
 return swapped

def computeCRC ( data ) : crc = 65535 for a in data : idx = __crc16_table [ ( ( crc ^ ord ( a ) ) & 255 ) ] crc = ( ( ( crc >> 8 ) & 255 ) ^ idx ) swapped = ( ( ( crc << 8 ) & 65280 ) | ( ( crc >> 8 ) & 255 ) ) return swapped
computes a crc16 on the passed in string .