Moak
Moak

Reputation: 12885

How to read binary data from Buffer node.js as number?

Currently I am receiving a message with my udp server it arrives as <Buffer 43 31 07 55 56> this is supposed to be an ID 4331075556

How can I convert <Buffer 43 31 07 55 56> to 4331075556?

Upvotes: 2

Views: 1891

Answers (1)

rysloan
rysloan

Reputation: 615

you need to specify an additional argument in toString():

obj.toString('hex')

Upvotes: 7

Related Questions