Top-level
Start here to find your way around the API. Three entry points cover the common tasks; everything else in the symbol list supports them.
| Start with | When you want to |
|---|---|
| EncodedFormat | Turn a @Serializable type into a short string, and back. |
| PackedFormat | Get the compact ByteArray without the text layer. |
| ByteEncoding | Encode raw bytes with a codec directly — Base62, Base36, Base64, Base85. |
val encoded = EncodedFormat.encodeToString(payload)
val decoded = EncodedFormat.decodeFromString<Payload>(encoded)Configure a format through its builder lambda: swap the codec, add a checksum, or chain PayloadTransforms. On the packed side, annotate Int/Long fields with PackedType and IntPacking to opt into varint or ZigZag.
Types
RFC 4648–compatible Base64 encoder/decoder.
URL- and filename-safe variant of Base64 using the BASE_64_URL alphabet.
Generic Base85 encoder/decoder supporting both ASCII85 and ZeroMQ Z85. 4 input bytes -> 5 output chars. Allows final partial group (1–3 bytes -> 2–4 chars).
Generic base-N encoder/decoder for binary data using arbitrary alphabets and block processing.
Abstraction for bidirectional byte–text encodings (e.g., Base62, Base64).
Alphabet backed by an explicit string of characters.
Strips leading zero bytes before encoding and restores them on decode.
Holds the configuration for an EncodedFormat instance.
Text StringFormat that produces short, predictable string tokens by composing:
Builder for configuring EncodedFormat instances.
Integer encoding strategy for Int and Long fields in PackedFormat.
Holds the configuration for a PackedFormat instance.
Binary decoder for the PackedFormat wire format. Reads merged class bitmask headers and per-field data produced by PackedEncoder.
Binary encoder for the PackedFormat wire format. Accumulates merged class bitmask headers and per-field data, producing output consumable by PackedDecoder.
Compact BinaryFormat optimized for small, flat Kotlin data classes.
Builder for configuring PackedFormat instances.
Overrides the integer encoding strategy for an Int or Long field in PackedFormat. Falls back to kotlinx.serialization.protobuf.ProtoType if present, then PackedConfiguration.defaultEncoding.
Transforms a binary payload before base-encoding and after base-decoding.
Alphabet backed by a contiguous Unicode range starting at start. Defaults to U+0020 – U+D7FF (55,264 characters), the largest BMP range that avoids surrogate code points.
Properties
Functions
Wraps this Checksum as a PayloadTransform that appends the digest on encode and strips and verifies it on decode.
Creates a customized EncodedFormat instance.
Creates a customized PackedFormat instance.
Chains two transforms into a pipeline.