Base64

Base64 object is used to encode/decode in base64.

Version 3.x

Basic Usage

1
2
3
4
5
6
7
8
var base64 = require('utils/v3/base64');
var response = require('http/v3/response');

response.println(base64.encode('admin:admin'));
response.println(base64.decode('YWRtaW46YWRtaW4='));

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

Definition

Functions


Function Description Returns
encode(input) Encode an input string to Base64 string
decode(input) Decode an input string from Base64 string

Compatibility

Rhino Nashorn V8


Version 2.x

Basic Usage

1
2
3
4
5
6
7
8
var base64 = require('utils/base64');
var response = require('net/http/response');

response.println(base64.encode('admin:admin'));
response.println(base64.decode('YWRtaW46YWRtaW4='));

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

Definition

Functions


Function Description Returns
decode(input) Decode an input string from Base64 string
encode(input) Encode an input string to Base64 string

Compatibility

Rhino Nashorn V8
Edit