2tvenom/cborencode
Composer 安装命令:
composer require 2tvenom/cborencode
包简介
CBOR encoder for PHP
关键字:
README 文档
README
Decoder/encoder from PHP data to CBOR binary string. This code has been developed and maintained by Ven at January 2014.
CBOR is an object representation format defined by the IETF. The specification has recently been approved as an IETF Standards-Track specification and has been published as RFC 7049.
Installation
Add 2tvenom/cborencode as a requirement to composer.json:
{ "require": { "2tvenom/cborencode": "1.0.0" } }
Usage
<?php include("vendor/autoload.php"); //target for encode $target = array(true, array("variable1" => 100000, "variable2" => "Hello, World!", "Hello!"), 0.234, 0, null, 590834290589032580); //encoded string $encoded_data = \CBOR\CBOREncoder::encode($target); //debug info output $byte_arr = unpack("C*", $encoded_data); echo "Byte hex map = " . implode(" ", array_map(function($byte){ return "0x" . strtoupper(dechex($byte)); }, $byte_arr)) . PHP_EOL; echo "Byte dec map = " . implode(" ", $byte_arr) . PHP_EOL; //decode $decoded_variable = \CBOR\CBOREncoder::decode($encoded_data); //output var_dump($decoded_variable);
Compatibility
Checked with Ruby extension in encode and decode
Known issues
- Not support tags. 6 major type (in future)
- Not support 16 and 32 floats encoding (maybe in future)
- All floats will be serialized only as IEEE 754 Double-Precision Float (64 bits follow)
- Encode does't support indefinite-length values.
2tvenom/cborencode 适用场景与选型建议
2tvenom/cborencode 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.95M 次下载、GitHub Stars 达 62, 最近一次更新时间为 2014 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cbor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 2tvenom/cborencode 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 2tvenom/cborencode 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 2tvenom/cborencode 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CBOR Encoder/Decoder for PHP
CBOR encoder/decoder for PHP
CBOR Encoder/Decoder Bundle for Symfony.
CBOR decoder
A CBOR encoder/decoder for PHP
CBOR, CAR, and CID binary encoding for AT Protocol in PHP
统计信息
- 总下载量: 13.95M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 62
- 点击次数: 29
- 依赖项目数: 16
- 推荐数: 1
其他信息
- 授权协议: PHP
- 更新时间: 2014-09-30