kencode

Changelog

Synced from GitHub Releases.

  1. v1.4.0

    Correctness and density release: PackedFormat packs enums and nullable elements more tightly, malformed and non-canonical input is rejected consistently, and several roundtrip and decoding edge cases are fixed.

    Breaking changes

    • Encoded outputs differ from v1.3.0 for classes with nullable fields, enums, or Boolean/enum lists, and for BaseRadix with alphabets larger than 256 characters. Base62, Base36, Base64 and Base85 output is unchanged. Old strings may fail to decode or decode to different values, so encode stored strings again.
    • Decoding rejects non-canonical input: padding bits, varints, null markers, UTF-8, Base64/Base85 groups, radix digits and CompactZeros prefixes.
    • Custom Base64/Base85 alphabets must have the right length, no duplicates, no characters at or above U+0100, and no = in Base64.
    • The checksum builder property appends to the current transform instead of replacing it.
    • Encoding a value whose @EncodeDefault(NEVER) element is skipped throws SerializationException.
    • Encoding a String with an unpaired surrogate throws IllegalArgumentException instead of writing ?.
    • Requires Kotlin 2.3 or newer; the JVM target is lowered to Java 17.

    Changes

    • feat: enable snapshot releases to Sonatype snapshots repo #11
    • chore: update kbuild to 1.3.6 (now from GitHub releases), Kotlin to 2.4, Gradle to 9.7.1 and CI to JDK 25, provision toolchains with foojay, standardize GitHub workflows, and publish snapshots on every push to main #9, #10, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #40, #41
    • fix: preserve packed serialization boundaries #26
    • fix: reject malformed base64 and base85 input #27
    • fix: roundtrip empty compact zero payloads #28
    • fix: preserve large alphabet block lengths #29
    • feat: improve packed serialization density #30
    • fix: track nullable generic and tuple elements in the class bitmask #31
    • fix: reject malformed and non-canonical packed input #32
    • fix: validate codec configuration and reject non-canonical text #33
    • refactor: reduce duplication across packed codec and byte encodings #34
    • fix: bound collection decoding by the remaining input #35
    • fix: reject elements skipped by EncodeDefault NEVER #36
    • fix: reject non-canonical packed bits, markers and UTF-8 #37
    • fix: reject non-canonical CompactZeros prefixes and radix digits #38
    • fix: bound zero-width collections and roundtrip map entries and polymorphic primitives #42
    • docs: tighten comments, KDoc and README, and state the wire format compatibility contract #39, #42, #43

    Full changelog: v1.3.0...v1.4.0

  2. v1.3.0

    Toolchain refresh: Kotlin 2.3.20, Gradle 9.5.1, kbuild 1.2.1, with kotlinx-serialization now pinned via an auto-applied platform BOM.

    • chore: bump kbuild to 1.2.1 with an auto-applied kbuild-platform BOM and drop the macosX64 target.
    • chore: bump Kotlin and the kotlinx-serialization plugin to 2.3.20.
    • fix: address typed-detekt findings from kbuild 1.2.1.
    • ci: create a GitHub Release on tag push and run lintDocs in CI.
    • docs: rework the README and add KDoc to satisfy UndocumentedPublic detekt rules.
    • chore: add a pull request template.

    Full Changelog: https://github.com/Eignex/kencode/compare/v1.2.4...v1.3.0

  3. v1.2.4

    CI-focused release that runs the full test suite on every build, uploads test reports, and renames Base64UrlSafe for consistency.

    • refactor: rename Base64UrlSafe to Base64Url.
    • ci: run allTests in CI and upload test reports as artifacts.
    • ci: make the codecov upload step non-fatal.

    Full Changelog: https://github.com/Eignex/kencode/compare/v1.2.3...v1.2.4

  4. v1.2.3

    Maintenance release with a BaseRadix correctness fix for very large power-of-two radixes, new alphabet abstractions, and build stability improvements.

    • fix: correct BaseRadix for massive power-of-two bases.
    • feat: add UnicodeRangeAlphabet and CharAlphabet interfaces for richer character encoding options.
    • refactor: streamline encodeBlock logic in BaseRadix and add byte-handling helpers.
    • perf: optimize buffer usage and simplify encodeBlock input handling.
    • build: raise the Gradle JVM heap to avoid out-of-memory errors during builds.

    Full Changelog: https://github.com/Eignex/kencode/compare/v1.2.2...v1.2.3

  5. v1.2.2

    Restructures the project as Kotlin Multiplatform with wasm and iOS targets, adds payload transforms (encryption, compact-zeros) in place of the checksum interface, and merges class and object bitmask headers for tighter output.

    • build: migrate the project to a Kotlin Multiplatform structure.
    • build: extend build configuration to include wasm and iOS targets.
    • refactor: replace the Checksum interface with a PayloadTransform interface for payload processing.
    • refactor: integrate CompactZeros as a PayloadTransform and remove the standalone compactZeros flag.
    • feat: implement merged bitmask headers for classes and objects via a new PackedContext class.
    • refactor: consolidate boolean and nullable bitmask handling into a ClassBitmask utility.
    • refactor: streamline varint encoding and decoding in EncodedFormat.
    • feat: allow configurable initial capacity for ByteOutput in EncodedFormat.
    • ci: add a linter step to GitHub Actions and an .editorconfig.
    • docs: add README examples and links for encryption and error correction extensions.

    Full Changelog: https://github.com/Eignex/kencode/compare/v1.2.1...v1.2.2

  6. v1.2.1

    Internal cleanup release that unifies the CRC implementations behind a shared engine and tightens BaseRadix visibility.

    • refactor: introduce a unified CrcEngine shared by CRC8, CRC16, and CRC32.
    • test: simplify CRC test structure for better coverage and clarity.
    • refactor: change encodeBlock and decodeBlock visibility to internal in BaseRadix.

    Full Changelog: https://github.com/Eignex/kencode/compare/v1.2.0...v1.2.1

  7. v1.2.0

    Replaces the per-property VarInt/VarUInt annotations with a single PackedType annotation, consolidates integer encoding configuration, and tightens collection encoding and decoding.

    • feat: replace VarInt and VarUInt annotations with a unified PackedType annotation.
    • refactor: consolidate defaultVarInt and defaultZigZag into a single defaultEncoding property on PackedFormat.
    • perf: optimize nullable collection handling and bitmask logic in PackedEncoder and PackedDecoder.
    • test: add tests for boolean and nullable list encoding and truncation exceptions.
    • feat: add an error message for checksum size violations during EncodedFormat decoding.
    • fix: improve UTF-8 string handling and error reporting in readStringInline.

    Full Changelog: https://github.com/Eignex/kencode/compare/v1.1.0...v1.2.0

  8. v1.1.0

    Adds a builder DSL for configuring EncodedFormat and PackedFormat, a FixedInt annotation for overriding default integer encoding, and assorted decoder fixes for nullable and polymorphic cases.

    • feat: add builder DSL configuration for EncodedFormat and PackedFormat.
    • feat: add the FixedInt annotation to force fixed-length integer encoding when defaults differ.
    • fix: improve nullable element decoding and enforce structure constraints in PackedDecoder.
    • test: add test coverage for polymorphic serialization, truncation, and nullable lists.
    • docs: update the README to document the new DSL and Maven coordinates.

    Full Changelog: https://github.com/Eignex/kencode/compare/v1.0.0...v1.1.0

  9. v1.0.0

    Initial release of kencode, a Kotlin Multiplatform library for compact binary encoding with kotlinx.serialization integration, base-N text encodings, and CRC checksums.

    • feat: provide a flexible BaseRadix encoder supporting arbitrary radixes.
    • feat: include Base64 (standard and URL-safe) and Base85 implementations.
    • feat: add CRC8, CRC16, and CRC32 checksum implementations with reflected variants.
    • feat: introduce the PackedFormat for compact kotlinx.serialization output with bit packing.
    • feat: introduce the EncodedFormat that pairs PackedFormat with byte encoding and checksums.
    • feat: support nullable types, enums, UInt/ULong, and default object handling.
    • feat: add varint, zigzag varuint, and fixed-width integer encoding helpers.
    • docs: include example usages for protobuf-style and cipher-based serialization.
    • build: ship GitHub Actions for build and release.

    Full Changelog: https://github.com/Eignex/kencode/commits/v1.0.0