(self)
return self.set_global_field(self.HASH_KEY, new_hash)
Calculates the hash of the data file and adds it to the global section.
        Also returns a string representation of the hash.
Calculates the hash of the data file and adds it to the global section.
        Also returns a string representation of the hash.
Calculates the hash of the data file and adds it to the global section . Also returns a string representation of the hash .
def calculate_hash(self):
        """
        Calculates the hash of the data file and adds it to the global section.
        Also returns a string representation of the hash.
        """
        old_hash = self.get_global_field(self.HASH_KEY)
        new_hash = sigmf_hash.calculate_sha512(self.data_file)
        if old_hash:
            if old_hash != new_hash:
                raise SigMFFileError('Calculated file hash does not match associated metadata.')

        return self.set_global_field(self.HASH_KEY, new_hash)
def calculate_hash ( self ) : old_hash = self . get_global_field ( self . HASH_KEY ) new_hash = sigmf_hash . calculate_sha512 ( self . data_file ) if old_hash : if old_hash != new_hash : raise SigMFFileError ( 'Calculated file hash does not match associated metadata.' ) return self . set_global_field ( self . HASH_KEY , new_hash )