import base64


def encode_from_str(data: str) -> str:
    """
    Base64-encodes a string for transmission and storage.
    :param data: The string to encode
    :return: string representation of base64-encoded string
    """
    data_bytes = bytes(data, "utf-8")
    data_encoded_bytes = base64.b64encode(data_bytes)
    data_encoded_str = str(data_encoded_bytes, "utf-8")
    return data_encoded_str