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.
...
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.
#14This 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!
::codec/illegal-stream
error.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