firehed/cbor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

firehed/cbor

最新稳定版本:0.1.0

Composer 安装命令:

composer require firehed/cbor

包简介

CBOR decoder

关键字:

README 文档

README

Tools for working with the CBOR data format in PHP

Installation

composer require firehed/cbor

Usage

Note: Only decoding is supporing at this time

Decoding

$decoder = new Firehed\CBOR\Decoder();

$binaryString = "\x18\x64"; // CBOR for int(100)
$data = $decoder->decode($binaryString);

// OR
$byteArray = [24, 100];
$data = $decoder->decodeArrayOfBytes($byteArray);

There is currently very limited support for tagged types. When an unsupported tag is encountered, an OutOfBoundsException will be thrown.

Tagged type support

  • 0 DateTime as string
  • 1 DateTime as epoch
  • 2 Positive Bignum (returns as string, requires bcmath)
  • 3 Negative Bignum (same)
  • 4 Decimal fraction
  • 5 Bigfloat
  • 21 base64url string
  • 22 base64 string
  • 23 base16 string
  • 24 CBOR
  • 32 URI
  • 33 base64url
  • 34 base64
  • 35 regexp
  • 36 MIME message
  • 55799 Self-describing CBOR

统计信息

  • 总下载量: 26.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-14