Strangely seems pack() doesn't support *signed* 64bit little-endian, while it support unsigned, so how do I pack a signed one?
For reference, if I want an unsigned 64bit little-endian pack(), i would simply do
$packed = pack("P", $i);
Strangely seems pack() doesn't support *signed* 64bit little-endian, while it support unsigned, so how do I pack a signed one?
For reference, if I want an unsigned 64bit little-endian pack(), i would simply do
$packed = pack("P", $i);
From php official docs pack
Note that the distinction between signed and unsigned values only affects the function unpack(), where as function pack() gives the same result for signed and unsigned format codes.