ext-encoding icon indicating copy to clipboard operation
ext-encoding copied to clipboard

Array-of-type decode/encode

Open dktapps opened this issue 9 months ago • 0 comments

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).

dktapps avatar Mar 14 '25 17:03 dktapps