NODE.JS sample code for the signature calculation
'use strict';
var crypto = require('crypto');
var sign = function(apiCmd, keyString) {
var usablePrivateKey = keyString.replace(/[-]/g, '+').replace(/[_]/g, '/');
var privateKeyBytes = new Buffer(usablePrivateKey, 'base64');
var algorithm = crypto.createHmac('sha1', privateKeyBytes);
var hash = algorithm.update(apiCmd).digest('base64');
var signature = hash.replace(/[+]/g, '-').replace(/[/]/g, '_');
return signature;
};
module.exports = sign ;
console.log(sign("COMMAND_ITEM_TO_SIGN", "YOUR_PRIVATE_KEY"));