import base64


def _b64url(input: bytes) -> str:
    """
    Encode data as base64 urlsafe with stripped padding (as specified in the JWS RFC7515).
    """
    return base64.urlsafe_b64encode(input).decode().rstrip('=')