cbor

module
v0.0.0-...-113f422 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2017 License: Apache-2.0

README

Concise Binary Object Representation (CBOR) is a superset of JSON's schema that's faster and more compact.

This repository is moving to github as two new repositories, one for Go, one for Python: https://github.com/brianolson/cbor_py https://github.com/brianolson/cbor_go

This repository contains implementations for Python and Go.

Python

This Python implementation provides loads()/dumps() like the json standard library.

Compare to Python 2.7.5's standard library implementation of json:

#!

serialized 50000 objects into 1163097 cbor bytes in 0.05 seconds (1036613.48/s) and 1767001 json bytes in 0.22 seconds (224772.48/s)
compress to 999179 bytes cbor.gz and 1124500 bytes json.gz
load 50000 objects from cbor in 0.07 secs (763708.80/sec) and json in 0.32 (155348.97/sec)

There is also a pure-python implementation which gets about 1/3 the speed of json's C augmented speed.

Tested in Python 2.7.5, 2,7.6, 3.3.3, and 3.4.0

Available on pypi:

pip install cbor

Go

import cbor "bitbucket.org/bodhisnarkva/cbor/go"

The Go implementation is newer. It attempts to do serialization to/from struct types using reflection, but doesn't do 100% of cases like that right. It should do everything fine serializing map[string]interface{} and []interface{} and other basic types. It passes the test of decoding 100% of CBOR common appendix test strings.

Directories

Path Synopsis
CBOR is IETF RFC 7049, the "Concise Binary Object Representation" http://tools.ietf.org/html/rfc7049 In can be thought of as "binary JSON" but is a superset and somewhat richer representation than JSON.
CBOR is IETF RFC 7049, the "Concise Binary Object Representation" http://tools.ietf.org/html/rfc7049 In can be thought of as "binary JSON" but is a superset and somewhat richer representation than JSON.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL