Decode a String from Base64

Steps

  1. Create a project utils_project.
  2. Create a JavaScript service with the name base64_decode.js.
  3. Enter the following content:
1
2
3
4
5
6
7
8
9
10
11
12
13
var base64 = require('utils/v3/base64');
var response = require('http/v3/response');

var input = 'PT4/';
var result = base64.decode(input);

console.log('decoded: ' + result);
response.println(JSON.stringify('decoded: ' + result));

response.flush();
response.close();


For more information, see the API documentation.

Edit