Releases: christophhagen/BinaryCodable
3.0.3
3.0.2
Improves performance during encoding, especially for very large properties.
3.0.1
What's Changed
- Fix crash when using wrappers with other encoders by @christophhagen in #19
Full Changelog: 3.0.0...3.0.1
3.0.0
New format
Huge update! This release changes the binary format as well as much of the implementation.
This means that the new version is not compatible with older encodings, but the new implementation is much more stable, supports more features, and is faster. And all of that with about half the lines of code!
The older binary format (still documented in LegacyFormat.md
was initially developed to provide some cross-compatibility with Google Protocol Buffers. But Protobuf has a very limited feature set, and time (and lots of bugs) has shown that a fresh start was needed. The new format has been redesigned specifically for Codable
, and supports all1 features, while still being almost equally efficient.
A few additional notes:
- Migration info is provided in the Readme.
- The new binary format is detailed in
BinaryFormat.md
- Protobuf compatibility was dropped. This functionality will be moved to ProtobufCodable in the next few weeks.
-
The only known feature to be only partially supported is
encodeNil(forKey:)
. See the Readme for details. ↩
2.0.3
What's Changed
- Provide
codingPath
when decoding fails due to corrupt data by @mrackwitz in #10 - Decoding fails for optional varlength values in a singleValueContainer nested in keyed containers by @mrackwitz in #11
- Update ci by @christophhagen in #12
- Update docs by @christophhagen in #13
Full Changelog: 2.0.2...2.0.3
2.0.2
Fixes an issue where a custom encoding logic using a single value container would fail to decode.
Thanks to @mrackwitz for the discovery and fix.
What's Changed
- Decoding fails for keyed structs in a
singleValueContainer
by @mrackwitz in #9
New Contributors
- @mrackwitz made their first contribution in #9
Full Changelog: 2.0.1...2.0.2
2.0.1
This bugfix release addresses an issue where decoding would fail when custom decoding logic was implemented using variable-length types (e.g. String
, Data
) within an unkeyedContainer
.
The bug is fixed without changes to the encoded format.
2.0.0
This release brings breaking changes to the binary format, and fixes several errors with encoding of optionals.
- Unkeyed containers no longer have a
nil index set
by default. - Optionals are encoded using an additional byte to indicate a value or
nil
- The
nil index set
is only needed for custom implementations - Uses the standard
EncodingError
andDecodingError
instead ofBinaryEncodingError
andBinaryDecodingError
- Fixes encoding errors for UUID, double-optionals and custom implementations using optionals.
Throwing fix
This minor release changes the function signature of a function on BinaryFileDecoder
to allow the closure to throw errors.
Streams and files
This release adds support for new features:
Streams
New BinaryStreamEncoder
and BinaryStreamDecoder
classes to directly encode sequences of elements into a binary stream, which can be decoded continuously as new data becomes available.
File streams
Use BinaryFileEncoder
and BinaryFileDecoder
to sequentially encode elements to binary files, and read them back without keeping the whole file content in memory.
Sequences of optionals
Use the prependNilIndexSetForUnkeyedContainers
option to change the encoding of sequences containing optional values (arrays, sets, ...).