Convert to base64?

Hello Losant Team!

Do you know how convert data in base64? Maybe a node?

Thanks! :slight_smile:

Hi Jonathan,

There are a few ways to convert data to base64.

If you are using an Embedded workflow then we do have a Base64 Encode Node and Base64 Decode Node.

However if you are using any other type of workflow, you can use a format helper like this {{ encodeBase64 data.str }}. Or you can also use the Function node, and transform your UTF8 string into a buffer and then into Base64. I would recommend you use the format helper as the Function node will take longer to complete than using the format helpers on a specific node that allows templates.

Hope this helps,
Erin

1 Like

Thanks for the Reply Erin. :slight_smile: