0.5.0
Pre-release
Pre-release
Warning
This extension is still under development. I don't recommend depending on it for production usage.
Also, please note that the API may still change again before the 1.0.0 release.
Changes since 0.4.1
- Introduced array-of-type encoder and decoder functions for short, int, long, double and float types (
BE,LEandVarint). These functions are 2-4x faster than encoding/decoding single elements with loops. Needless to say, they're also significantly faster than legacy code usingBinaryStream. ByteBufferhas been split intoByteBufferReaderandByteBufferWriterparts.ByteBufferReaderrequires a string in the constructor and puts its offset at the start.ByteBufferWriterdoes not require anything (but can be given a starting string) and puts its offset at the end.
- Increased test coverage to verify symmetry of all encode/decode methods
- VarInts are now tested against known binary values to ensure parity with
pocketmine/binaryutils - Added
BEandLEmethods forUnsignedLong. Note that these still technically return signed longs, since PHP doesn't have an unsigned type; however, these allow code to be more self-documenting when e.g. implementing a protocol.