from pathlib import Path
import hashlib
import base64


def create_md5(path: Path) -> str:
    """Create MD5 from file."""
    with path.open("rb") as f:
        md5 = hashlib.md5(f.read()).digest()
        encoded_content_md5 = base64.b64encode(md5)
        content_md5 = encoded_content_md5.decode()
    return content_md5