def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("input_json", nargs="?", type=argparse.FileType('r'),
                        default=sys.stdin)
    args = parser.parse_args()
    logging.basicConfig()

    event_json = dictobj(json.load(args.input_json))

    algorithms = {
        "sha256": hashlib.sha256,
    }

    for alg_name in event_json.hashes:
        if check_event_content_hash(event_json, algorithms[alg_name]):
            print "PASS content hash %s" % (alg_name,)
        else:
            print "FAIL content hash %s" % (alg_name,)

    for algorithm in algorithms.values():
        name, h_bytes = compute_event_reference_hash(event_json, algorithm)
        print "Reference hash %s: %s" % (name, encode_base64(h_bytes))
dataset/ETHPy150Open matrix-org/synapse/scripts-dev/check_event_hash.py/main/original