Implementations

CBOR is simple enough to implement from scratch for a specific application.
For applications where that is not desirable, generic implementations are available for a variety of platforms. Many of these implementations stay private, but some are published with liberal open-source licenses such as the Apache 2.0 or the MIT license.
Many implementations use a simple API of the form:
encoded = CBOR.encode(data)data = CBOR.decode(encoded)


JavaScript

JavaScript implementations are available both for in-browser use and for node.js.

Browser

A CBOR object can be installed via bower install cbor and used as an AMD module or global object in the browser e.g. in combination with Websockets…

View details »

node.js

… and the server side for that might be written using node.js; install via: npm install cbor

View details »

Dart

A CBOR encoder/decoder suite with a test suite that incorporates the encode/decode tests from RFC7049 and more is now available in the Darts package ecosystem:

View details »

PHP

API: \CBOR\CBOREncoder::encode($target) and \CBOR\CBOREncoder::decode($encoded_data)

View details »

Go

An early Go implementation that feels like the JSON library:

View details »

Another, more full-grown Go implementation:

View details »

Most recently, a comprehensive, high-performance implementation has become available as part of a larger set of data representation format en- and decoders:

View details »

Rust

A Rust implementation is available that works with Cargo and is on crates.io:

View details »

Another Rust implementation has also become available recently on crates.io:

View details »

An implementation using Serde, a framework for serializing and deserializing Rust data structures efficiently and generically, is available on crates.io:

View details »

Swift

A Swift implementation without a Foundation dependency (cross-platform ready):

View details »

Julia

CBOR.jl is a Julia package for working with the CBOR data format, providing straightforward encoding and decoding for Julia types. Install via: Pkg.add("CBOR")

View details »

Lua

Lua-cbor is a pure Lua implementation of CBOR for Lua 5.1—5.3, which utilizes struct packing and bitwise operations if available:

View details »

“The most comprehensive CBOR module in the Lua universe” supports everything mentioned in RFC 7049 and the extensions registered with the IANA so far. It comes with parts implemented in C.

View details »

lua-ConciseSerialization is a pure Lua implementation of CBOR with variants for both 5.1 and 5.3; install via luarocks install lua-conciseserialization.

View details »

Python

Install a high-speed implementation via pypi: pip install cbor (and/or possibly pip3 install cbor)

View details »

Flynn's' simple API is inspired by existing Python serialisation modules like json and pickle:

View details »

Flunn is a fork of flynn, fixing some compatibility issues and with some refactoring:

View details »

Install a high quality implementation that supports most CBOR tags, including those for representing cyclic (recursive) references, via pip install cbor2

View details »

Perl

Install a comprehensive implementation tailored to Perl's many features via: cpan CBOR::XS

You'll like the performance data…

View details »

Ruby

A high-speed implementation has been derived from the MessagePack implementation for Ruby. Installation: gem install cbor

View details »

Ruby bindings for libcbor are now available. Installation: gem install libcbor

View details »

Erlang, Elixir

cbor-erlang is a recent implementation in Erlang:

View details »

An older Elixir implementation is also available:

expm spec excbor --format scm | sh

Or look at the source:

View details »

Haskell

Now on hackage:

View details »

Clojure

clj-cbor is an extensible, native Clojure implementation of the CBOR format:

View Details »

C#, Java

A rather comprehensive implementation that addresses arbitrary precision arithmetic is available in both a C# and a Java version.

View details »

Java

A Java implementation as part of the popular Jackson JSON library is at:

View Details »

A Java 7 implementation focusing on test coverage and a clean separation of model, encoder and decoder is at:

View Details »

JACOB, a small CBOR encoder and decoder implemented in plain Java is at:

View Details »

borabora supports graph queries and lazy decoding of stream elements:

View Details »

Cyborg supports a stream parsing/generation API without the need to adapt your data to a specific model:

View Details »

C, C++

A CBOR implementation in C is part of the RIOT operating system for constrained nodes:

View Details »

A C implementation for highly constrained nodes, which achieves a full CBOR decoder in 880 bytes of ARM code (and now also includes an encoder), has recently become available.

View Details »

A basic C++ implementation is also available:

View Details »

libcbor provides a fully-fledged C99 implementation, including streaming and incremental processing functionality:

View details »

TinyCBOR is Intel's industrial strength C/C++ implementation of CBOR, as used in the IoTivity framework:

View details »

JSON for Modern C++ — a header-only C++ library that aims to promote JSON to a first-class data type in C++11 — now supports CBOR as (de)serialization format.

View details »

A Qt İmplementation is at:

View details »

D

A compact D implementation with a Dub package:

View Details »