samedi 4 avril 2015

assign hex ascii value to buffer js

I'm writing in node.js and I need to assign a hex value of



39 7B 00 00 14 00 00 00 00 00 10 65 64 69 74 65 64 20 6D 73 67



To a variable called "newPayload"


the newPayload is defined like this:



var newPayload = this.dispatch(id, decryptedPayload);


Middleware.prototype.dispatch = function(id, payload) {
if (!this.events[id])
return;

return this.events[id].call(this, id, payload);
};


How would I assign those values to the variable?


Thanks!


Aucun commentaire:

Enregistrer un commentaire