Extra Characters after base64 Decoding

Hi Colin,

The issue has been resolved.
I was using msg.payload for decoding but instead I only required the message data not the whole message object. So I replaced Buffer.from(msg.payload, 'base64') in my code to Buffer.from(JSON.parse(msg.payload).data, 'base64').
It is working now without giving any random data.

Thank you for your help.