I’m working on an automation that I need to first convert a string to Base64 and then hash it with SHA256. I’ve searched the community and found some stuff, but the config is failing.
For the Base64 conversion, I used a manual Set which goes to a Code function. The code function runs the below:
The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined [line 1, for item 0]
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
n8n has its own dedicated method to base64 encode strings, namely base64Encode().
Here’s a simple workflow to demonstrate this method as well hashing the message (using Crypto mode).