import hashlib


def validate_hash(path, hash):
    """Validate a file against an MD5 hash value."""

    md5 = hashlib.md5()

    with open(path, 'rb') as f:
        while True:
            chunk = f.read(10000000)
            if not chunk:
                break
            md5.update(chunk)

    return md5.hexdigest() == hash