import hashlib


def md5(path):
    """
    Compute MD5 hash of file. Read it in chunks, so we don't need to fix the entire file in memory.
    :param path: Path of file to hash.
    :return: Hash value
    """
    hash_md5 = hashlib.md5()
    with open(path, "rb") as f:
        for chunk in iter(lambda: f.read(4096), b""):
            hash_md5.update(chunk)
    return hash_md5.hexdigest()