Using a string as hex not as string


in my flow i'm working with xml-files. The xml-file is translated to json so every xml-tag is already a json-key with string-value.
One of the xml-values should not be a string-type it shout be hex:


When i use and translate the above value i get the correct form:


So what i want to do now is changing the type of the above string as hex so that i can transform it to a real string.

I read a lot of posts in this forum where someone wants to translate an already existing buffer. But in my case i don't have a buffer but node-red has the false data-type :slight_smile: Everytime i try to transform with tostring() the classes use my input as string.

Thanks and all the best,

See this...

Essentially - you can use a function node


msg.payload = Buffer.from("HEX_STRING_HERE","hex").toString()
return msg;

Some proof...

thanks a lot!

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