Wiki

Clone wiki

cbor-lite / Frequently Asked Questions

Why yet another C++ implementation of CBOR?

CBOR-lite was designed to meet requirements which were not (and are not) meet by other implementations. Prior to implementing CBOR-lite, a number of existing implementations were examined, including all C++ implementations listed at CBOR.io. All were deemed not suitable for our needs due to various reasons, including:

  • not a Modern C++ implementation
  • not a "header only" implementation
  • not self-contained
  • not sufficiently portable
  • CBOR API not sufficiently separate/independent of non-CBOR feature APIs (e.g., JSON APIs)
  • license

What are the CBOR-lite implementation requirements?

At a high level, CBOR-lite was/is designed to support Modern C++ applications needs to encode/decode CBOR-based protocols. An additional, somewhat unique requirement (at least as a stated requirement) of the CBOR-lite implementation is to facilitate use in accredited implementations of application protocols, such as requirements placed on software to be used in various deployment scenarios (e.g., aviation). While each particular accreditation process has its own set of requirements to be met, there are some common themes. Generally speaking, a simple, small, focused, self-contained implementations are easier to accredit than complex, larger than necessary, non-focused, and non-self-contained implementations.

Detail technical requirements

  • Modern C++ "header only" implementation of CBOR including:
    • Canonical and Strict Mode
  • Demonstrative correct
  • Simple, Small
  • CBOR only
  • Dependent only on Standard C++ language and Standard C++ library features
  • Reasonably portable with minimal conditional compiled code
  • support LP32/ILP32/LP64/LLP64 data models

Are there non-requirement?

Yes! In particular, is no requirement at this time for CBOR-Lite to directly support

  • generic encoders/decoders
  • indefinite-length encodings
  • float point numbers
  • highly optimized (correct code is more important than fast code)

Note however that CBOR-lite does support single- and double- precision floating point numbers.

Does CBOR-lite support indefinite-length encodings?

No.

Does CBOR-lite support floating point numbers?

Single- and double-precision floating point numbers are directly supported. Half-precision floating point numbers are not, but may be implemented by the application using low-level CBOR-lite encoder/decoders.

Does CBOR-lite support Canonical CBOR?

CBOR-lite can be used to produce Canonical CBOR encodings. CBOR-lite can detect some but not all non-Canonical CBOR encodings.

Does CBOR-lite support Strict Mode?

CBOR-lite can be used by applications in support of Strict Mode decoding.

Updated