Skip to content

Commit

Permalink
Merge pull request #9 from francislavoie/patch-1
Browse files Browse the repository at this point in the history
Fix biging -> bigint typo
  • Loading branch information
2tvenom authored Mar 27, 2018
2 parents e170361 + 8ac22bc commit 1cb7614
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CBOR/CBOREncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private static function decode_int($length_capacity, &$byte_string){
switch(true)
{
case $length_capacity == self::ADDITIONAL_TYPE_INT_UINT64:
return self::biging_unpack($decoding_byte_string);
return self::bigint_unpack($decoding_byte_string);
break;
case array_key_exists($length_capacity, self::$length_pack_type):
$typed_int = unpack(self::$length_pack_type[$length_capacity], $decoding_byte_string);
Expand Down Expand Up @@ -374,7 +374,7 @@ private static function pack_number($major_type, $int)
//custom big int pack
if(is_null($length))
{
return self::pack_init_byte($major_type, self::ADDITIONAL_TYPE_INT_UINT64) . self::biging_pack($int);
return self::pack_init_byte($major_type, self::ADDITIONAL_TYPE_INT_UINT64) . self::bigint_pack($int);
}

return self::pack_init_byte($major_type, $length) . pack(self::$length_pack_type[$length], $int);
Expand Down Expand Up @@ -422,13 +422,13 @@ private static function is_assoc(&$arr)
* @param $big_int
* @return string
*/
private function biging_unpack($big_int)
private function bigint_unpack($big_int)
{
list($higher, $lower) = array_values(unpack("N2", $big_int));
return $higher << 32 | $lower;
}

private static function biging_pack($big_int)
private static function bigint_pack($big_int)
{
return pack("NN", ($big_int & 0xffffffff00000000) >> 32, ($big_int & 0x00000000ffffffff));
}
Expand Down

0 comments on commit 1cb7614

Please sign in to comment.