#!/usr/bin/env python

import hashlib

def my_file_hash(filename, buffer_size=1024):
    with open(filename, "rb") as f:
        h = hashlib.md5(f.read(buffer_size))
        while data := f.read(buffer_size):
            h.update(data)
    return h


if __name__ == "__main__":
    if my_file_hash("file1.txt") == my_file_hash("file2.txt"):
        print("The files are identical")
    else:
        print("The files are different")
