"revert" serial port and base64 nodes forwards....

undo buffer syntax updates
This commit is contained in:
Dave Conway-Jones
2017-06-30 19:52:20 +01:00
parent 0609645375
commit f6e71bf962
4 changed files with 13 additions and 13 deletions

View File

@@ -16,12 +16,12 @@ module.exports = function(RED) {
// Take base64 string and make into binary buffer
var regexp = new RegExp('^[A-Za-z0-9+\/=]*$');
if ( regexp.test(msg.payload) && (msg.payload.length % 4 === 0) ) {
msg.payload = new Buffer.from(msg.payload,'base64');
msg.payload = new Buffer(msg.payload,'base64');
node.send(msg);
}
else {
//node.log("Not a Base64 string - maybe we should encode it...");
msg.payload = (new Buffer.from(msg.payload,"binary")).toString('base64');
msg.payload = (new Buffer(msg.payload,"binary")).toString('base64');
node.send(msg);
}
}

View File

@@ -1,6 +1,6 @@
{
"name" : "node-red-node-base64",
"version" : "0.0.5",
"version" : "0.0.6",
"description" : "A Node-RED node to pack and unpack objects to base64 format",
"dependencies" : {
},