ext-encoding
ext-encoding copied to clipboard
Array-of-type decode/encode
Decoding & encoding an array of simple types is the last thing that unpack() (probably) does better than this extension.
This issue proposes the addition of functions such as:
LE::readUnsignedIntArray(ByteBuffer $buffer, int $size) : list<int>
LE::writeUnsignedIntArray(ByteBuffer $buffer, list<int> $elements) : void
These would be especially beneficial in the case of varints, for which there's currently no way to read a batch without a naive PHP for-loop (which is, obviously, very slow).