Converting byte-stream into numeric data-type

后端 未结 4 679
不思量自难忘°
不思量自难忘° 2021-01-16 01:11

Let\'s say I have a byte-stream in which I know the location of a 64-bit value (a 64-bit nonce). The byte-order is Little-Endian. As PHP\'s integer data-type is limited to 3

4条回答
  •  被撕碎了的回忆
    2021-01-16 01:45

    Two years late to the party, but if anyone still cares: unpack is the built-in way to go here, you can unpack it as a couple of 32-bit ints, or as a double.

提交回复
热议问题