import base64


def int_to_slug(i: int) -> str:
    """
    Turn an integer id into a semi-opaque string slug
    to use as the permalink.
    """
    byt = str(i).encode("utf-8")
    slug_bytes = base64.urlsafe_b64encode(byt)
    return slug_bytes.decode("utf-8")