codemelted.js Module
    Preparing search index...

    Function json_btoa

    • Creates a Base64-encoded ASCII string from a binary string (i.e. a string in which each character in the string is treated as a byte of binary data).

      Parameters

      • data: string

        The binary string.

      Returns string | null

      The base64 encoded string or null if the encoding failed.

      // Encode base64
      let encoded = json_btoa("Hello World!");
      // Decode base64
      let decoded = json_atob(encoded);