Download the PHP package sqrt-cat/proto-bin without Composer
On this page you can find all versions of the php package sqrt-cat/proto-bin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sqrt-cat/proto-bin
More information about sqrt-cat/proto-bin
Files in sqrt-cat/proto-bin
Download sqrt-cat/proto-bin
More information about sqrt-cat/proto-bin
Files in sqrt-cat/proto-bin
Vendor sqrt-cat
Package proto-bin
Short Description A PHP library similar to protobuf for binary protocol packaging/unpacking, which can package biz data into binary format for efficient transmission. Implemented using native PHP with no other external dependencies. Supports data types such as fixed length and variable length.
License MIT
Package proto-bin
Short Description A PHP library similar to protobuf for binary protocol packaging/unpacking, which can package biz data into binary format for efficient transmission. Implemented using native PHP with no other external dependencies. Supports data types such as fixed length and variable length.
License MIT
Please rate this library. Is it a good library?
Informations about the package proto-bin
ProtoBin
ProtoBin 是一个使用PHP原生开发的二进制协议的序列化库。在 PHP 前提下,理念与 Protobuf 类似,但更加简单易用。
支持数据类型
定长类
const TYPE_TINYINT = 'tinyint'; const TYPE_INT16 = 'int16'; const TYPE_INT32 = 'int32'; const TYPE_INT64 = 'int64';
变长类
const TYPE_STRING = 'string'; const TYPE_TEXT = 'text';
你可能会吐槽为何没有非标量数据类型,其实可以序列化后用text类型来存储。
示例代码
消息体定义
打包/解包业务数据
对比二进制的传输协议与表单、文本类协议的字节数,可以发现二进制协议的传输效率更高。
All versions of proto-bin with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6
The package sqrt-cat/proto-bin contains the following files
Loading the files please wait ...