@eoussama/firemitt
    Preparing search index...

    Class Base64helper

    Helper class for Base64 encoding and decoding of messages.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Decodes a Base64 string back into a message.

      This static method takes a Base64 encoded string and decodes it back into a message of type TMessage<T>. It first decodes the Base64 string into a JSON string, and then parses this JSON string back into a message object.

      Type Parameters

      • T = unknown

        The expected type of the payload in the decoded message.

      Parameters

      • base64: string

        The Base64 encoded string to be decoded.

      Returns TMessage<T>

      The decoded message object.

    • Encodes a message into a Base64 string.

      This static method takes a message of type TMessage<T> and converts it into a Base64 encoded string. It first stringifies the message into JSON, and then encodes this JSON string into Base64.

      Type Parameters

      • T = unknown

        The type of the payload in the message.

      Parameters

      • message: TMessage<T>

        The message to be encoded.

      Returns string

      The Base64 encoded string representation of the message.