import base64


def b64_encode(value: bytes) -> bytes:
    """
    URL safe base 64 encoding of a value
    :param value: bytes
    :return: bytes
    """
    return base64.urlsafe_b64encode(value).strip(b"=")