goldies
    Preparing search index...

    Function toBase64

    • Encodes a string to Base64. The string is encoded as UTF-8 first. Works in Node.js and browsers.

      Parameters

      • OptionalinputString: string = ''

        The string to encode.

      Returns string

      The Base64 encoded string.

      const encoded = toBase64('Hello World'); // 'SGVsbG8gV29ybGQ='