문제

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

  • obj.toString() returns C1UV
  • parseInt(obj) returns NaN
  • JSON.stringify(obj) returns [67,49,7,85,86]

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

도움이 되었습니까?

해결책

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

obj.toString('hex')
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top