Function to convert b64 to hex?

Dear,
I need to create a formula to convert b64 to hexa.
Thanks in advances

Base64 to Buffer (array of numbers)

Buffer.from('AQIDBAU=', "base64")
→ <Buffer 01 02 03 04 05>

Base64 to Hexadecimal String...

Buffer.from('AQIDBAU=', "base64").toString("hex")
→ '0102030405'

Or use the node-red-node-base64 node

1 Like

Dear Expert,
I have a issue to convert b64 to Hexa, I found the B64 convert but I didn't get a correct result
Please I need your support and advise, thank you so much in advance.

.



Please can someone help me on this topic.
To split the data in order to covert b64 to Hexa
Thanks in advances

I showed you how to convert base64 string to hexadecimal string

What exactly does this mean?

Can you provide

  • sample data (not a picture, but actual string/text that can be copied+pasted)
  • what you expect it to become

e.g...

  • data: AQIDBAU=
  • expected result: 0102030405

Anytime that you see red bars or boxes around your input fields, you have a configuration problem.

Notice that in your first screenshot, the b64node's Property field has msg. prefix selected... but in the value field you have typed .data?

Then in the debug sidebar, there is the error message (next to the red bar):

"Error: Invalid property expression: unexpected . at position 0"

Try removing the leading "." from the b64 property...

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.