import posixpath
import base64


def resolve_path(name: str, url: str) -> str:
    """Transform a URL into a filesystem-safe filename."""
    url_base = posixpath.dirname(url)
    return '.'.join((
        name,
        str(base64.b64encode(bytes(url_base, 'utf-8')), 'utf-8'),
        'inv'))