import hashlib


def md5_file(fname: str) -> str:
    """Return md5sum of file contents"""
    # https://stackoverflow.com/questions/3431825/generating-an-md5-checksum-of-a-file
    hasher = hashlib.md5()
    with open(fname, "rb") as source:
        for chunk in iter(lambda: source.read(4096), b""):
            hasher.update(chunk)
    return hasher.hexdigest()