Module base module

module hex

hex encoding and decoding module

Citation:

1 2
var encoding = require('encoding'); var hex = encoding.hex;

or

1
var hex = require('hex');

static function

encode

encode data in hex

1
static String hex.encode(Buffer data);

Call parameters:

  • data:Buffer, the data to be encoded

Return result:

  • String, returns the encoded string

decode

Decode string to binary data in hex mode

1
static Buffer hex.decode(String data);

Call parameters:

  • data: String, the string to decode

Return result:

  • Buffer, returns the decoded binary data