New Contributor

ALE 0MQ parsing with NodeJS does'nt decripts correctly

I'm trying to decrypt a messages from the 0mq queue.
We are using the provided  schema.proto and with NodeJS protobuf.js  lybrary. I'm able to load the schema correctly, but when I attempt to decrypt the message I got this:

index out of range: 90 + 10 > 90

This is my snippet of code:

protobuf.load(path.join(__dirname, 'schema.proto'), function(err, root) {
    if (err) throw err;
    var schema = root.lookup('ce.nbapi.presence'); // here I have the schema correctly
    console.log('Topic: ', topic.toString());
    console.log('Message:', message);
    try {
      // Decode an Uint8Array (browser) or Buffer (node) to a message
      var m = schema.decode(message);
    } catch (error) {

I have spent several days on this and I think I'm close.
This is a string after decrypt:


{apName: '*\u0006\u0000\f)"�x�\u001f?\n\b\n\u0006�\u001fr���\u0010\u0000\u001a\u00147�����L��\u000fYwDe������"\u0011f0:5c:19:cb:9f:ae*\b\n\u0006�\\\u00199��' }


This should to be a MAC address, so I guess that this is a format problem.
There is a custom type in my .proto that is an object and if I have a format problem and because that fails when the library try to decrypt it.

Maybe I have to parse my Uint8Array before passing it to protobuf?
Have you ever had a similar problem?


Search Airheads
Showing results for 
Search instead for 
Did you mean: