Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (24 sloc) 611 Bytes
layout title icon group
samples
Encode a String to Hexadecimal Format
fa-caret-right
simple

{{ page.title }}

Steps

  1. Create a project utils_hex.
  2. Create a JavaScript service with the name hex_encode.js.
  3. Enter the following content:
var hex = require('utils/v3/hex');
var response = require('http/v3/response');

var input = [65, 66, 67];
var result = hex.encode(input);

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

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

For more information, see the API documentation.