Re: signed int64 pack/unpack [message #184580 is a reply to message #184578] |
Sun, 12 January 2014 02:46 |
cameron7
Messages: 8 Registered: January 2014
Karma:
|
Junior Member |
|
|
Hi, yes, sorry I am running 64-bit OS and 64-bit PHP. PHP_INT_MAX is giving appropriate value.
Specifics from `php -i`: PHP Version => 5.4.6-1ubuntu1.5
The code has become extremely ugly, and still not working perfectly, thus the reason for trying to find others who may have experience with this. The pack / unpack functions don't provide support for 64-bit integers directly so I'm looking for at least a sound "hack".
I've tried all sorts of things, from base_convert to simply trying to extract and iterate over a bitwise comparison against each bit in 4 separate 16-bit ints, but nothing I've tried so far is working correctly.
Basically, the context for this is I'm writing a client for a custom protocol in which several of the components of that protocol in requests and responses require big endian 64-bit signed int, thus the reason for the need to pack / unpack.
|
|
|