integer - pack format "Q" on PHP 5.5 / 32 bit machines
I would like to implement something as described here: https://webapps.stackexchange.com/a/101153 in PHP. So far the following seems to be working:
return rtrim(strtr(base64_encode(pack('Q', $int64)), '+/', '-_'), '=');
$bytes = base64_decode(strtr($data, '-_', '+/')); return unpack('Q', $bytes);
Unfortunately this only works on 64bit systems and PHP5.6.3+ where the "Q" format of pack/unpack was introduced.
What possibilities do I have to implement the same function that would work the same on php5.5 64 & 32 bit?