def crc_update(crc, data):
if not isinstance(data, array.array) or data.itemsize != <NUM_LIT:1>:<EOL><INDENT>buf = array.array("<STR_LIT:B>", data)<EOL><DEDENT>else:<EOL><INDENT>buf = data<EOL><DEDENT>crc ^= _MASK<EOL>for b in buf:  <EOL><INDENT>table_index = (crc ^ b) & <NUM_LIT><EOL>crc = (CRC_TABLE[table_index] ^ (crc >> <NUM_LIT:8>)) & _MASK<EOL><DEDENT>return crc ^ _MASK<EOL>
Updates CRC-32C checksum with data. Copied from
    https://github.com/TeamHG-Memex/tensorboard_logger/blob/master/tensorboard_logger/_crc32c.py

    Parameter
    ---------
      crc : int
          32-bit checksum to update as long.
      data : byte array
          string or iterable over bytes.

    Returns
    -------
    int
        32-bit updated CRC-32C as long.