cborg

Concise Binary Object Representation (CBOR)

LTS Haskell 14.17:0.2.2.0
Stackage Nightly 2019-12-16:0.2.2.0
Latest on Hackage:0.2.2.0

See all snapshots cborg appears in

BSD-3-Clause licensed by Duncan Coutts

Module documentation for 0.2.2.0

This version can be pinned in stack with:cborg-0.2.2.0@sha256:eaee50d09d766af95ba18348e4fc230243033b98633ed46ccb5ae85efef7dc6c,4779

This package provides an efficient implementation of the Concise Binary Object Representation (CBOR), as specified by [RFC 7049](https:/tools.ietf.orghtml/rfc7049).

If you are looking for a library for serialisation of Haskell values, have a look at the serialise package, which is built upon this library.

An implementation of the standard bijection between CBOR and JSON is provided by the cborg-json package. Also see [cbor-tool](packagecbor-tool) for a convenient command-line utility for working with CBOR data.

This package was formerly known as binary-serialise-cbor.

Changes

Revision history for cborg

0.2.2.0 – 2019-07-31

  • Add peekByteOffset for the current ByteOffset in the input byte sequence. By keeping track of the byte offsets before and after decoding asubterm (a pattern captured by decodeWithByteSpan) and if the overall input data is retained then this is enables later retrieving the span of bytes for the subterm.

  • Add encodePreEncoded function. This allows pre-encoded CBOR data to be included into an Encoding. This is useful in cases where one has known-valid encoded CBOR data, e.g. on disk, that you want to include into a larger CBOR data stream. This makes it possible in such cases to avoid decoding and re-encoding.

  • Improved test suite property coverage. We now have property coverering most parts of a commuting diagram, which gives more confidence about what are the right properties to test and what is enough.

  • Improved test coverage for decoding non-canonical terms

  • Fix a bug in the checks in the canonical decoding of float16 NaNs. There are multiple bit representations of NaNs and while we were checking this correctly for float32 and float64 we were not checking this correctly for the float16 encoding.

  • Improved test coverage for special float values. We now have pretty comprehensive coverage of round-tripping properties for special float values, +/- infinity and non-canonical NaNs.

  • Improved the structure of the test suite

  • Use new GHC primitives castWord{32ToFloat,64ToDouble} rather than home grown

  • Support GHC built with integer-simple

  • Support GHC 8.8

0.2.1.0 – 2018-10-11

  • Bounds bumps and GHC 8.6 compatibility

0.2.0.0 – 2017-11-30

  • Improved robustness of non-UTF-8 strings

  • Add encoders and decoders for ByteArray

  • Add decoding variants that check for canonical encodings

  • Expose Codec.CBOR.Read.deserialiseFromBytesWithSize

0.1.0.0 – 2017-06-28

  • First version. Released on an unsuspecting world.
comments powered byDisqus