The problem is actually with your node.js code :) If you look at what's in your buffer:
> var s = String.fromCharCode(0x00,0x2B,0x20,0xFC);
undefined
> var b = new Buffer(s);
undefined
> b
<Buffer 00 2b 20 c3 bc>
> b.length
5
You'll see that it's magically turned the string into a 5 byte buffer. Most likely it's because it is interpreting your string as a UTF8 string, when I guess you intended to use it just as a string of bytes.
> var s = String.fromCharCode(0x00,0x2B,0x20,0xFC);
undefined
> var b = new Buffer(s,'ascii');
undefined
> b
<Buffer 00 2b 20 fc>
> b.length
4
> b.toString('base64');
'ACsg/A=='
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The problem is actually with your node.js code :) If you look at what's in your buffer:
You'll see that it's magically turned the string into a 5 byte buffer. Most likely it's because it is interpreting your string as a UTF8 string, when I guess you intended to use it just as a string of bytes.