goldies
    Preparing search index...

    Function fromBase64

    • Decodes a Base64 encoded string to text, reading the bytes as UTF-8. Accepts the standard and URL-safe alphabets, with or without padding. Works in Node.js and browsers.

      Parameters

      • base64String: string = ''

        The Base64 encoded string to decode.

      Returns string

      The decoded string, or an empty string if the input is not valid Base64.

      const decoded = fromBase64('SGVsbG8gV29ybGQ='); // 'Hello World'