Skip to content

BASE64.ENCODE

Kirill Chernyshov edited this page Mar 13, 2019 · 1 revision

The BASE64.ENCODE Function

Function Group: Base64

BASE64.ENCODE returns the base64 encoded version of a given string.

Syntax

BASE64.ENCODE(arg1)

  • arg1 is a string

Uses

Let's say we receive some user information like that shown below:

{
   "data":{
      "user":{
         "name": "secret_username",
         "password": "secret_password"
      }
   }
}

If we want to transform that user information into an authentication token, we can use BASE64.ENCODE:

CONCATENATE("Bearer ", BASE64.ENCODE(JOIN(":", data.user.name, data.user.password)))

This will return Bearer c2VjcmV0X3VzZXJuYW1lOnNlY3JldF9wYXNzd29yZA==.

Notes

To perform the opposite operation, decoding a given base64 encoded string, use BASE64.DECODE

Clone this wiki locally