mp_bintools/docs/bipack.md

32 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2023-03-16 01:03:45 +03:00
# Module mp_bintools
2023-03-15 13:21:59 +03:00
2024-02-19 03:33:45 +03:00
## Collection of binary tools
Most interesting:
- Full set of CRC: [net.sergeych.bintools.CRC]
- Binary bit-effective __BiPack format__ serializer: [net.sergeych.bipack.BipackEncoder] and [net.sergeych.bipack.BipackDecoder]. Also typed key-value storage for it, see [net.sergeych.bipack.KVStorage] and its delegates and [net.sergeych.bipack.defaultNamedStorage].
- Multiplatform synchronization tools, that works the same and properly on JS, native and JVM, see [net.sergeych.synctools]
- many general-purpose utilities that simplify binary data processing, see package [net.sergeych.bintools] below.
2023-03-15 13:21:59 +03:00
2023-03-16 01:03:45 +03:00
# Package net.sergeych.bipack
2023-03-15 13:21:59 +03:00
2023-04-01 19:27:16 +03:00
Bipack is a common kotlinx serializer that works pretty much like any other `kotlinx.serialization` format. You just mark your class as `@Serializable` and it does the rest.
2023-03-15 13:21:59 +03:00
2023-03-16 01:03:45 +03:00
- [BipackEncoder] to serializes anything to bipack format.
2023-03-16 01:09:51 +03:00
- [BipackDecoder] deserializes from bipack back.
2023-03-15 13:21:59 +03:00
2023-03-16 01:03:45 +03:00
There are also special annotation to fine tune the format: [Extendable], [Framed], [CrcProtected] for classes and [Unsigned] for integer data fields.
2023-03-15 13:21:59 +03:00
2023-03-16 01:03:45 +03:00
# Package net.sergeych.bintools
2023-03-15 13:21:59 +03:00
2023-03-16 01:03:45 +03:00
General-purpose binary tools: encoding to bytes, hex, binary dumps. variable length integer, ect. Most of it is used internally by bipack serializers, see [net.sergeych.bipack] for details.
2023-03-15 13:21:59 +03:00
2024-02-19 03:33:45 +03:00
In particular, see [Varint] and [Smartint] variable-length compact integer codecs and also [DataSource] and [DataSink] multiplatform synchronous read/write interfaces.
# Package net.sergeych.synctools
To write a code that compiles and runs, and most likely works on the
JS, native, and JVM, we need some portable/compatible synchronization
primitives. This package is a collection of such.