Module basic 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 encode

return result:

  • String, returns the encoded string

decode

Decodes a string into binary data in hex

1
static Buffer hex.decode(String data);

Call parameters:

  • data: String, the string to decode

return result:

  • Buffer, returns the decoded binary data