def do_hash(hash_algo, marfile, asn1=False):
<EOL>dst = tempfile.TemporaryFile()<EOL>with open(marfile, '<STR_LIT:rb>') as f:<EOL><INDENT>add_signature_block(f, dst, hash_algo)<EOL><DEDENT>dst.seek(<NUM_LIT:0>)<EOL>with MarReader(dst) as m:<EOL><INDENT>hashes = m.calculate_hashes()<EOL>h = hashes[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>if asn1:<EOL><INDENT>h = format_hash(h, hash_algo)<EOL><DEDENT>print(base64.b64encode(h).decode('<STR_LIT:ascii>'))<EOL><DEDENT>
Output the hash for this MAR file.