Hex to String & String to Hex conversion in nodejs
问题 I need to convert data into String to Hex and then again from Hex to String using nodejs 8 I have issue while decoding from Hex to String Code to convert string into hex function stringToHex(str) { const buf = Buffer.from(str, 'utf8'); return buf.toString('hex'); } Code to convert hex into string function hexToString(str) { const buf = new Buffer(str, 'hex'); return buf.toString('utf8'); } I have string dailyfile.host output of encoding :