Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
419 views

I have something similar to the following code: const fs = require('fs'); const imageBuffer = fs.readFileSync('path/to/image.jpg'); const binary = imageBuffer.toString('binary'); console.log(binary)...
Jack's user avatar
  • 437
4 votes
1 answer
3k views

I'm trying to implement authorization based on a hash-based message authentication code (HMAC)-encrypted authorization header. To do so I need to use the authorization header to verify the ...
flintpnz's user avatar
1 vote
0 answers
355 views

We have an Nodejs api endpoint that creates a pdf stream using the html-pdf and streams it through the response. This is working as expected, we can download the pdf through the browser. I am trying ...
Over Age's user avatar
1 vote
0 answers
3k views

I have a requirement in which I need to convert an input text to a png/jpeg file and then convert to base64 string and send as an input to an API. I cannot use node.js fs module since I cannot ...
Avinash's user avatar
  • 2,245
0 votes
1 answer
2k views

I wish to add an array to a buffer at a specific offset. This does not work: let buffer = Buffer.alloc(65); buffer.writeUInt8(0x91, 0); buffer.write([127, 0, 0, 1 ], 1); buffer.write("admin", 5); ...
robtot's user avatar
  • 1,069
2 votes
1 answer
2k views

I am trying to send out the binary content from a node.js server. To do this, I allocate a buffer and fill up the buffer with my content, and call response.write() on it. Once it returns, I reuse the ...
George Y.'s user avatar
  • 11.9k
1 vote
2 answers
2k views

I need to create a byte array with deferent data types in it, For example: i will have data that will contain Byte (0-100), Byte(0-10), Two bytes(-30-+100), Bool(0/1), Byte, Two Bytes(0-300). The ...
Erez's user avatar
  • 1,953
1 vote
0 answers
227 views

I have problem with to the raspberry's usb serial tx direction. I use npm's serialport software with node.js. If I plug the usb cable (max232) with windows to serialmonitor, I can see the hex code (...
Jdoe's user avatar
  • 21
3 votes
1 answer
6k views

Say I have a simple Buffer in Node.js like so: const bytes = Buffer.from('abcdefg'); this buffer instance has slice and concat as methods, but I am really not sure how to use these to basically ...
Alexander Mills's user avatar