def crc_update(crc, data):
 if ((type(data) != array.array) or (data.itemsize != 1)):
  buf = array.array('B', data)
 else:
  buf = data
 crc = (crc ^ _MASK)
 for b in buf:
  table_index = ((crc ^ b) & 255)
  crc = ((CRC_TABLE[table_index] ^ (crc >> 8)) & _MASK)
 return (crc ^ _MASK)

def crc_update ( crc , data ) : if ( ( type ( data ) != array . array ) or ( data . itemsize != 1 ) ) : buf = array . array ( 'B' , data ) else : buf = data crc = ( crc ^ _MASK ) for b in buf : table_index = ( ( crc ^ b ) & 255 ) crc = ( ( CRC_TABLE [ table_index ] ^ ( crc >> 8 ) ) & _MASK ) return ( crc ^ _MASK )
update crc-32c checksum with data .