PowerKeys Scripting API
    Preparing search index...

    Interface Base64API

    interface Base64API {
        Encode(text: string): string;
        Decode(base64: string): string;
    }
    Index
    • Encodes a UTF-8 string to its Base64 representation.

      Parameters

      • text: string

        The plain text to encode.

      Returns string

      The Base64-encoded string.

      const b64 = Base64.Encode("hello"); // "aGVsbG8="
      
    • Decodes a Base64 string back to UTF-8 text.

      Parameters

      • base64: string

        The Base64-encoded string.

      Returns string

      The decoded plain text.

      Throws a runtime error if the input is not valid Base64 or does not decode to valid UTF-8.

      const plain = Base64.Decode("aGVsbG8="); // "hello"