'Calculate the value for the ``DATASUM`` card given the input data'

def _calculate_datasum_with_heap(self, blocking):

    with _binary_table_byte_swap(self.data) as data:
        dout = data.view(type=np.ndarray, dtype=np.ubyte)
        csum = self._compute_checksum(dout, blocking=blocking)
        for idx in range(data._nfields):
            if isinstance(data.columns._recformats[idx], _FormatP):
                for coldata in data.field(idx):
                    if (not len(coldata)):
                        continue
                    csum = self._compute_checksum(coldata, csum, blocking=blocking)
        return csum
