1
0
mirror of https://github.com/danog/PHPStruct.git synced 2024-11-30 04:19:08 +01:00

Do not convert param to int in manual_q_pack function

This commit is contained in:
danogentili 2016-07-23 00:02:31 +02:00
parent 103d0452f5
commit 6f9e493cc0
2 changed files with 2 additions and 2 deletions

View File

@ -10,6 +10,7 @@ var_dump(\danog\PHP\Struct::unpack('2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx5pP',
)
));
var_dump(\danog\PHP\Struct::calcsize('n'));
var_dump(bin2hex(\danog\PHP\Struct::pack('q', 999999999999)));
// 2c x b x B x ? x h x H x i x I x l x L x q x Q x n x N x f x d x 2s x
//print(struct.unpack("2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx", struct.pack("2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx", "nv", 100, 100, False, 333, 444, 232423, 234342, 234234234234, 234234234234, 234234234234, 234234234234, 34434, 344434, 2.2343, 3.03424, "dd")));

View File

@ -589,7 +589,6 @@ class Struct
public function manual_q_pack($n, $blocksize = 8)
{
$s = null;
$n = (int)$n;
while ($n > 0) {
$s = $this->pack('>I', $n & 4294967295).$s;
$n = $n >> 32;