CBOR is a concise binary alternative to JSON, and is specified in RFC 7049.

fxamacker/cbor <https://github.com/fxamacker/cbor> is a CBOR library that 
is:

   - *Easy* -- idiomatic API like Go's encoding/json.
   - *Safe and reliable* -- avoids Go's unsafe, has 95+% coverage, and 
   passes 10+ hrs of fuzzing before each release.
   - *Standards-compliant* -- supports CBOR, including canonical CBOR 
   encodings (RFC 7049 and CTAP2).
   - *Small and self-contained* -- compiles to under 0.5 MB and has no 
   external dependencies.

Version 1.x has:

   - *Stable API* -- won't make breaking API changes.
   - *Stable requirements* -- won't require Go newer than v1.12.
   - *No known bugs* -- no open issues to fix bugs.
   - *Passed 30+ hrs of fuzzing* -- v1.1.1 on linux_amd64 using prior 
   corpus and RFC 7049 tests as seed.


This library balances speed, safety, and compiled size. To keep size small, 
it avoids code generation. For safety, it avoids Go's unsafe. For speed, it 
uses safe optimizations: cache struct metadata, bypass reflect when 
appropriate, use sync.Pool to reuse transient objects, and etc.

Program size comparisons (doing the same CBOR encoding and decoding):

   - 2.7 MB program using fxamacker/cbor v1.1.1
   - 10.7 MB program using ugorji/go v1.1.7 (without code generation)
   - 11.9 MB program using ugorji/go v1.1.7 (default build)


Changes to fxamacker/cbor since pre-1.0 announcement include:

   - v1.1.1 -- improve encoding speeds: slice 50%, struct 30%, and map 14%
   - v1.1.0 -- support encoding.BinaryMarshaler and 
   encoding.BinaryUnmarshaler interfaces
   - v1.0.x -- refactoring and cleanup


I'd love to know if you use this library, so please let me know (include 
your project link if possible).

Questions and suggestions are welcome.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d896ca2f-1a8d-4bb3-a01d-e775a1b1342e%40googlegroups.com.

Reply via email to