string-code.js
288 Bytes
'use strict';
const utf8ToHex = (string) => {
var buf = new Buffer(string, 'utf8');
return buf.toString('hex');
};
const hexToUtf8 = (string) => {
let buf = new Buffer(string, 'hex');
return buf.toString('utf8');
};
module.exports = {
utf8ToHex,
hexToUtf8
};