import hashlib


def check_md5(file1, file2):
    """ check whether the two files are the same """
    with open(file1, "rb") as f1:
        h1 = hashlib.md5(f1.read()).digest()
    with open(file2, "rb") as f2:
        h2 = hashlib.md5(f2.read()).digest()
    return h1 == h2