def calculate_hashes(self):
hashers = []<EOL>if not self.mardata.signatures:<EOL><INDENT>return []<EOL><DEDENT>for s in self.mardata.signatures.sigs:<EOL><INDENT>h = make_hasher(s.algorithm_id)<EOL>hashers.append((s.algorithm_id, h))<EOL><DEDENT>for block in get_signature_data(self.fileobj, self.mardata.signatures.filesize):<EOL><INDENT>[h.update(block) for (_, h) in hashers]<EOL><DEDENT>return [(algo_id, h.finalize()) for (algo_id, h) in hashers]<EOL>
Return hashes of the contents of this MAR file.

        The hashes depend on the algorithms defined in the MAR file's signature block.

        Returns:
            A list of (algorithm_id, hash) tuples