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.
...
This release fixes two of the longer-standing quirks with the library, which were unfortunately breaking changes. The fixes should be straightforward:
(cbor/decode ...)
with (cbor/decode-seq ...)
.(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))
clj-cbor.core/decode
now only decodes a single value; previous
behavior moved to decode-seq
.
#7clj-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 to spit
with :append true
.Long/MIN_VALUE
.Long
values, no matter their encoded
size. Previously, numbers between Short/MAX_VALUE
and Integer/MAX_VALUE
would return Integer
values.
#4
#5clj-cbor.core/self-describe
function will wrap the given value with this
tag.spit
, slurp
, and slurp-all
utility functions to the core namespace.:clj-cbor.codec/illegal-chunk
renamed to illegal-chunk-type
.decode
function now properly raises an error when the input ends
mid-value rather than at a top-level value boundary.This release includes 100% test coverage!
:clj-cbor.error/encoding-error
and :clj-cbor.error/decoding-error
.clj-cbor.data.model
renamed to clj-cbor.data.core
.clj-cbor.float16
functions from-bits
and to-bits
renamed to
decode
and encode
, respectively.Undefined
and SimpleValue
records moved to new clj-cbor.data.simple
namespace.TaggedValue
record moved to new clj-cbor.data.tagged
namespace.clj-cbor.header/write-major-int
renamed to write
.clj-cbor.header/read-size
renamed to read-code
.Initial project release.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close