I’m trying to take a Base64 string, convert it to a hex string and group the output by bytes.
I’d like the output of console.log(bufferString) to be:
03 67 00 cf 04 68 61 00 ff 01 2d
But I’m stuck with this output:
036700cf04686100ff012d
What I’ve got so far…
let request = {
"PayloadData": "A2cAzwRoYQD/AS0=",
"FPort": 10
}
let buffer = Buffer.from(request.PayloadData, 'base64');
let bufferString = buffer.toString('hex');
console.log(bufferString)