A fast, safe, and efficient CBOR serialization library for Swift on any platform. swiftpackageindex.com/thecoolwinter/CBOR/1.1.1/documentation/cbor
atproto swift cbor

Update README.md

authored by

Khan Winter and committed by
GitHub
2f7e7f4a 5ce56211

+15
+15
README.md
··· 19 19 20 20 The motivation for this library over existing implementations is twofold: performance, and reliability. Existing community implementations do not make correct use of Swift features like `Optional` and memory safety. This library aims to be safe while still outperforming other implementations. To that end, this library has been extensively [fuzz tested](./Fuzz.md) to ensure your application never crashes due to malicious input. At the same time, this library boasts up to a *74% faster* encoding and up to *89% faster* decoding than existing implementations. See [benchmarks](#benchmarks) for more details. 21 21 22 + ## Features 23 + 24 + - `Codable` API for familiar Swift project integration. 25 + - Customizable encoding options, such as date and key formatting. 26 + - Customizable decoding, with the ability to reject non-deterministic CBOR data. 27 + - Encoder creates deterministic CBOR data by default. 28 + - A scan pass allows for decoding only the keys you need from an encoded object. 29 + - Supports decoding half precision floats (Float16) as a regular Float. 30 + - Runs on Linux, Android, and Windows using the swift-foundation project when available. 31 + - Fuzz tested for reliability against crashes. 32 + - Supports tagged items (will expand and add ability to inject your own tags in the future): 33 + - Dates 34 + - UUIDs 35 + - Flexible date parsing (tags `0` or `1` with support for any numeric value representation). 36 + 22 37 ## Usage 23 38 24 39 This library utilizes Swift's `Codable` API for all (de)serialization operations. It intentionally doesn't support streaming CBOR blobs. After [installing](#installation) the package using Swift Package Manager, use the `CBOREncoder` and `CBORDecoder` types to encode to and decode from CBOR blobs, respectively.