for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the Tarantool Client package.
*
* (c) Eugene Leonovich <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tarantool\Client\Packer;
use Tarantool\Client\Exception\PackerException;
final class PackUtils
{
private function __construct()
}
public static function packLength(int $length) : string
return \pack('CN', 0xce, $length);
public static function unpackLength(string $data) : int
if (false === $data = @\unpack('C_/Nlength', $data)) {
throw new PackerException('Unable to unpack length value.');
return $data['length'];