jphp icon indicating copy to clipboard operation
jphp copied to clipboard

Missing pack and unpack functions for manipulating binary data

Open danog opened this issue 5 years ago • 4 comments

The pack and unpack functions for manipulating binary data are missing: they are extremely useful for a number of reasons, please consider implementing them.

danog avatar Mar 09 '20 11:03 danog

These functions are quite difficult to implement, because they have an intricate format for passing parameters, but they can still be implemented. It's necessary to spend a lot of time on this. It's sad that this functionality in PHP has such an ugly and confusing API compared to other languages.

dim-s avatar Mar 09 '20 15:03 dim-s

I have worked a lot with this function, I assume I can help out with that

danog avatar Mar 09 '20 15:03 danog

It would be cool. I can advise using the DataInputStream and DataOutputStream classes (https://www.boraji.com/java-datainputstream-and-dataoutputstream-example).

dim-s avatar Mar 09 '20 15:03 dim-s

You will also need binary strings, for this use the BinaryMemory class.

dim-s avatar Mar 09 '20 15:03 dim-s