Answer the question
In order to leave comments, you need to log in
How to limit the buffer by bytes and write only to the first byte?
In bl.append(Buffer.alloc(2, [34], 'hex'))
I want to write 1 byte 22, and leave the rest empty. It should turn out like this 22 00 , but I can’t figure out how to do it.
bl.append(Buffer.from([ obj.header ])) // Тег
bl.append(Buffer.alloc(2, [34], 'hex'))
a = Buffer.alloc(2)
a[1] = [34]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question