from pathlib import Path
import hashlib


def get_binary_hash(path: Path) -> str:
    """Return the MD5 hash of the given file."""
    hasher = hashlib.md5()
    with path.open("rb") as f:
        for chunk in iter(lambda: f.read(4096), b""):
            hasher.update(chunk)
    return hasher.hexdigest()