Base64 Decode helper

I’ve been trying to use the {{decodeBase64}} helper. The payload data:
“8H9PZcLWUE1BR0MwNDIzRgAAAAAAGwAB” converts to : \uFFFD\u007FOe\uFFFD\uFFFDPMAGC0423F\u0000\u0000\u0000\u0000\u0000\u001B\u0000\u0001

While an online base64 decoder outputs this:
F0 7F 4F 65 C2 D6 50 4D 41 47 43 30 34 32 33 46 00 00 00 00 00 1B 00 01
Any insight appreciated,
Stewart

Hi @Stewart_McCallum ,

Our {{decodeBase64}} helper returns a decoded string in UTF-8 character set. It looks like the online decoder you’re using is decoding it as hex.

We’ll look into adding an additional argument to the {{decodeBase64}} helper to specify the formatting. In the meantime, if you’re doing this in a workflow, you can use a Function Node to decode to hex. A simple example, which references data.value on the payload and stores the hex value as working.newValue :

const buffer = Buffer.from(payload.data.value, 'base64');
payload.working.newValue = buffer.toString('hex');

Thanks for the feedback, and please let us know if you have any other questions.

Excellent, thank you!