Cyborg is meant to be a comprehensive library for CBOR, providing multiple levels for working with this binary format:
- CyborgBrain, the lowest-level tools for working with binary data directly.
- Cyborg, an object model designed to be more directly usable by developers, plus tools to convert to and from binary data. Use this if you are leveraging CBOR data directly.
- CyborgCodable, support for encoding and decoding Swift objects into CBOR - either the object model or down to binary data.
There are two third-party runtime dependencies:
- SwiftNIO, used solely for its
ByteBuffertype to more easily allow for parsing and writing CBOR data - BigInt, used to support the range of integer values that CBOR supports outside the range of
Swift.Int. The library can be built withoutBigInt, in which case these larger values will return anErrorwhile deserializing/decoding. The hope is to eventually depend upon Swift Numerics once Arbitrary-precision Integers are added.