Module hex
hex encoding and decoding module
Reference method:
1
2var encoding = require('encoding');
var hex = encoding.hex;
or
1var hex = require('hex');
Static function
encode
Encode data in hex
1static String hex.encode(Buffer data);
Call parameters:
- data : Buffer , the data to be encoded
Return result:
- String , returns the encoded string
decode
Decode a string into binary data in hex mode
1static Buffer hex.decode(String data);
Call parameters:
- data : String, the string to be decoded
Return result:
- Buffer , returns the decoded binary data