Skip to content

Repository files navigation

Test results Latest release swift 5.6 shield Platforms: macOS

BinaryCoding

Adds support for using Swift's Codable to encode/decode objects and structs to/from binary data.

Adds DataEncoder and DataDecoder classes which can be used to code any codable object out-of-the-box to/from a Data object.

Also adds BinaryEncodable and BinaryDecodable protocols which entities can adopt if they want to provide an alternative binary encoding or decoding scheme.

This is useful for example when you need to support coding with a compact binary format, but also want to provide a cleaner JSON coding. You can let Swift's native coding support handle the JSON, and provide custom init(fromBinary:) or binaryEncode(to:) implementations for the binary support.

About

Swift Binary coding support

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages