All notable changes to this project will be documented in this file, which follows the conventions of keepachangelog.com. This project adheres to Semantic Versioning.
...
1.1.1 - 2022-06-20
- Update Clojure to 1.11.1
- Exclude the new
parse-uuid
function in Clojure 1.11 to avoid a reference collision warning.
1.1.0 - 2020-06-14
- The base logic in the codec will write any collection supporting the standard
Java
List
,Map
, andSet
interfaces as the corresponding CBOR types. Previously, this only worked directly on Clojure's collection types. - Local calendar dates are supported using the proposed tags 100 (epoch) and
1004 (string), mapped to the
java.time.LocalDate
type.
1.0.0 - 2020-04-20
- Errors about unhandled types now contain more type information about the value that could not be encoded. #15
- The
clj-cbor.core/dispatch-superclasses
function can be used to support inheritance-based write handler selection. #12
0.7.2 - 2019-06-28
- Add clj-async-profiler support in the benchmarking code to produce flame graphs for finding hotspots.
- Codecs no longer support a configurable set tag; it is now fixed at 258 matching the IANA registry.
decode
will not try to coerce inputs which are already input streams anymore. This fixes incremental/lazy decoding behavior. #13encode
will not try to coerce outputs to an output stream anymore. Now an exception is thrown when a bad argument is given. This prevents lost writes when the final buffer is not flushed correctly. #14
0.7.1 - 2019-01-10
This is a performance-focused release that introduced a number of changes to speed up decoding performance. The main change is the switch to a jump table for the initial header byte. #9 #11
For a representative data sample of about ~97 KB, this brings the benchmarked decoding time from 8.454 ms to 4.089 ms, or about twice as fast!
- Upgrade to Clojure 1.10.0.
- Many operations in the codec are type-hinted to use primitive operations where possible.
- CBOR arrays and maps are built up using transients for performance.
- Decoding logic now uses a jump table.
- A tagged-value major type with a streaming info code now results in a
::codec/illegal-stream
error.
0.6.0 - 2017-12-23
- Upgrade to Clojure 1.9.0.
0.5.0 - 2017-11-08
This release fixes two of the longer-standing quirks with the library, which were unfortunately breaking changes. The fixes should be straightforward:
- Replace any
(cbor/decode ...)
with(cbor/decode-seq ...)
. - Replace any
(first (cbor/decode-seq ...))
with(cbor/decode ...)
.
If you have existing encoded data containing sets, you can use the following function to rewrite it:
(defn rewrite-cbor-sets
[codec source dest]
(with-open [input (io/input-stream source)
output (io/output-stream dest)]
(->>
input
(cbor/decode-seq (assoc codec :set-tag 13))
(cbor/encode-seq codec output))))
If rewriting isn't an option, you can support reading sets via tag 13 by using a custom read handler:
(def compatible-codec
(assoc-in cbor/default-codec [:read-handlers 13] set))
- Breaking: the default set tag is now 258, matching the IANA registry. #6
- Breaking:
clj-cbor.core/decode
now only decodes a single value; previous behavior moved todecode-seq
. #7
clj-cbor.core/encode-seq
writes a sequence of values to a byte array or output stream.clj-cbor.core/spit-all
similarly writes a sequence of values to an output file like repeated calls tospit
with:append true
.
0.4.1 - 2017-05-17
- Resolved an overflow issue when encoding
Long/MIN_VALUE
. - Integer values are always decoded as
Long
values, no matter their encoded size. Previously, numbers betweenShort/MAX_VALUE
andInteger/MAX_VALUE
would returnInteger
values. #4 #5
0.4.0 - 2017-03-14
- Implemented canonical mode sorting of map keys and set entries.
0.3.0 - 2016-01-05
- Support self-describe CBOR tag 55799. This provides a 'magic' three-byte
sequence to simplify detection of the CBOR format. The
clj-cbor.core/self-describe
function will wrap the given value with this tag. - Tag codes have been factored out into integer constants where appropriate to improve consistency.
- Add
spit
,slurp
, andslurp-all
utility functions to the core namespace.
- Read handler functions are no longer called with the tag. This greatly simplifies their implementation and allows for reuse of existing transformation functions as-is.
- Error type
:clj-cbor.codec/illegal-chunk
renamed toillegal-chunk-type
.
- The
decode
function now properly raises an error when the input ends mid-value rather than at a top-level value boundary.
0.2.0 - 2016-12-28
This release includes 100% test coverage!
- UUIDs are supported in binary form using tag 37.
- CBOR error keywords are organized into a hierarchy underneath
:clj-cbor.error/encoding-error
and:clj-cbor.error/decoding-error
.
clj-cbor.data.model
renamed toclj-cbor.data.core
.- The
clj-cbor.float16
functionsfrom-bits
andto-bits
renamed todecode
andencode
, respectively. Undefined
andSimpleValue
records moved to newclj-cbor.data.simple
namespace.TaggedValue
record moved to newclj-cbor.data.tagged
namespace.clj-cbor.header/write-major-int
renamed towrite
.clj-cbor.header/read-size
renamed toread-code
.
- Generally tighted up namespaces and reduced linkage where possible.
0.1.0 - 2016-12-23
Initial project release.