Hex

Hex object is used to encode/decode text/binary in hexadecimal format.

Version 3.x

Basic Usage

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

response.println(hex.encode('Hex Encoded'));
response.println(hex.decode('48657820456e636f646564'));

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

Definition

Functions


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

Compatibility

Rhino Nashorn V8


Version 2.x

Basic Usage

1
2
3
4
5
6
7
8
9
10
11
/* globals $ */
/* eslint-env node, dirigible */

var hex = require('utils/hex');
var response = require('net/http/response');

response.println(hex.encode('Hex Encoded'));
response.println(hex.decode('48657820456e636f646564'));

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

Definition

Functions


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

Compatibility

Rhino Nashorn V8
Edit