binary-parser icon indicating copy to clipboard operation
binary-parser copied to clipboard

Take a parsed value for computing not for parsing

Open mok-liee opened this issue 7 years ago • 1 comments

Hello binary-parser Team,

thanks for binary-parser. I found it last week and it is the simplest and best binary parser i've seen.

I have a question or feature request. Is it possible to use a parsed value only for computing in a next section ob a binary block?

Parser.start()
  .string('length', {encoding: 'ascii', length: 2, formatter: str2int})
  .skip(23)
  .array('position', {
    type: 'int32be',
    length: "length"
  });

Here u can see i want to parse the length to find the length for my array. But i dont want the value 'length' in my parsed output.

Is this possible?

mok-liee avatar Feb 08 '18 15:02 mok-liee

I have the same question.

jardicc avatar Feb 23 '18 12:02 jardicc