Swiftpack.co - jverkoey/BinaryCodable as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Swift Codable-like interfaces for binary representations.
.package(url: "https://github.com/jverkoey/BinaryCodable.git", from: "0.3.1")

Binary Codable

Binary Codable provides Swift Codable-like interfaces for converting types to and from binary representations.

Binary Codable is optimized for reading and writing blocks of binary data as a stream of bytes. This makes Binary Codable useful for network protocols, binary file formats, and other forms of tightly-packed binary information.

This is not an official Google product.


  • ☑ Encode from Swift types to Data.
  • ☑ Decode from Data to Swift types.
  • ☑ Efficiently encode/decode large blocks of arbitrary data.
  • ☑ Lazy decoding (read bytes from a source only as they're needed).
  • ☑ Encode and decode fixed-width integer types.
  • ☑ Encode and decode strings with or without terminators.
  • ☑ Cap decoding containers to a maximum length.

Known usage in the wild

  • BinaryCookies: Read and write Apple's .binarycookies files.
  • MySqlConnector: A pure Swift implementation of the MySql client/server protocol.

Supported technologies

  • iOS 13.0+ / macOS 10.15+
  • Xcode 11.5+
  • Ubuntu 16.04
  • Swift 5.2


BinaryCodable is released under the Apache 2.0 license. See LICENSE for more details.


Stars: 370
Last commit: 1 year ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

1 year ago

This patch release fixes a crashing bug introduced in 0.3.0 that occurred when decoding two-byte values from misaligned memory.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics