This package is abandoned and no longer maintained. No replacement package was suggested.

A PHP implementation of Concise Binary Object Representation (CBOR)

1.0.0 2018-10-15 14:03 UTC

This package is auto-updated.

Last update: 2022-04-15 22:43:24 UTC


Build Status Coverage Status Latest Stable Version Total Downloads License

A PHP implementation of RFC 7049: Concise Binary Object Representation (CBOR)


  • Encodes and decodes all examples described in RFC 7049
  • Provides a fluent interface builder for CBOR messages
  • Supports semantic tags
  • Supports 64bit integer values


Encoding Example

$output = new \SplTempFileObject();

(new \DASPRiD\Cbor\CborEncoder($output))->encode((new \DASPRiD\Cbor\CborBuilder())

$length = $output->ftell();
$encodedBytes = $output->fread($length);

Decoding Example

$dataItems = \DASPRiD\Cbor\CborDecoder::decodeString($encodedBytes);

foreach ($dataItems as $dataItem) {
    // Process data item