PHPackages                             spomky-labs/cbor-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spomky-labs/cbor-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spomky-labs/cbor-php
====================

CBOR Encoder/Decoder for PHP

3.2.2(6mo ago)596.4M—4.2%14[1 issues](https://github.com/Spomky-Labs/cbor-php/issues)[3 PRs](https://github.com/Spomky-Labs/cbor-php/pulls)20MITPHPPHP &gt;=8.0CI passing

Since Aug 21Pushed 2w ago3 watchersCompare

[ Source](https://github.com/Spomky-Labs/cbor-php)[ Packagist](https://packagist.org/packages/spomky-labs/cbor-php)[ GitHub Sponsors](https://github.com/Spomky)[ Patreon](https://www.patreon.com/FlorentMorselli)[ RSS](/packages/spomky-labs-cbor-php/feed)WikiDiscussions 3.3.x Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (41)Used By (20)

CBOR for PHP
============

[](#cbor-for-php)

[![CI](https://github.com/Spomky-Labs/cbor-php/actions/workflows/ci.yml/badge.svg)](https://github.com/Spomky-Labs/cbor-php/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/4531830406807915e1a49856c392b6b0ef8f0dd7fa4c03d0f2eb2ed79a6ee688/68747470733a2f2f706f7365722e707567782e6f72672f73706f6d6b792d6c6162732f63626f722d7068702f76)](https://packagist.org/packages/spomky-labs/cbor-php)[![Total Downloads](https://camo.githubusercontent.com/5aa3bc0046883511572c1b18915b5c09acfde69a707f1091b585d409ffcf5eee/68747470733a2f2f706f7365722e707567782e6f72672f73706f6d6b792d6c6162732f63626f722d7068702f646f776e6c6f616473)](https://packagist.org/packages/spomky-labs/cbor-php)[![License](https://camo.githubusercontent.com/99e368b1d30d64de1d68f0a980a15c951c1779e59195d99eaea48d6e96d6b603/68747470733a2f2f706f7365722e707567782e6f72672f73706f6d6b792d6c6162732f63626f722d7068702f6c6963656e7365)](https://packagist.org/packages/spomky-labs/cbor-php)

A comprehensive PHP library for encoding and decoding **CBOR** (Concise Binary Object Representation) data according to [RFC 8949](https://tools.ietf.org/html/rfc8949).

Features
--------

[](#features)

- ✅ Full support for all CBOR major types (0-7)
- ✅ Extensible tag system with built-in support for common tags
- ✅ Streaming decoder for efficient memory usage
- ✅ Type-safe API with modern PHP 8.0+ features
- ✅ Comprehensive support for indefinite-length objects
- ✅ Built-in normalization to PHP native types

Installation
------------

[](#installation)

```
composer require spomky-labs/cbor-php
```

**Requirements:**

- PHP 8.0 or higher
- ext-mbstring
- brick/math

**Optional but recommended:**

- ext-gmp or ext-bcmath for improved performance with large integers
- ext-bcmath for Big Float and Decimal Fraction support

This project follows [semantic versioning](http://semver.org/) strictly.

Quick Start
-----------

[](#quick-start)

```
