Hi,
I have base64 data and I would like to convert it to Hex … Is it possible to use Decode Text under Computed - Experimental Column. If so, what do I put into Encoding/Decoding Column. I tried using Hex but it does not work. Appreciate feedback. Thank you.
You can try this in a JavaScript column.
function base64ToHex(base64) {
try {
const raw = atob(base64);
let hex = '';
for (let i = 0; i < raw.length; i++) {
const hexChar = raw.charCodeAt(i).toString(16);
hex += (hexChar.length === 2 ? hexChar : '0' + hexChar);
}
return hex;
} catch (err) {
return '';
}
}
return base64ToHex(p1)
Not sure if your example string is valid base64, but it returned an error for me.
Thanks Thinh … looks correct for me.