[removed] reading 3 bytes Buffer as an integer

前端 未结 3 1150
小蘑菇
小蘑菇 2021-02-07 02:04

Let\'s say I have a hex data stream, which I want to divide into 3-bytes blocks which I need to read as an integer.

For example: given a hex string 01be638119704d4

3条回答
  •  北海茫月
    2021-02-07 02:18

    I'm using this, if someone knows something wrong with it, please advise;

    const integer = parseInt(buffer.toString("hex"), 16)
    

提交回复
热议问题