MessagePack
MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves.
Usage
import MessagePack
let packed = pack(.UInt(42))
//packed is [0x2a]
let unpacked = try? unpack([0x2a])
//unpacked is 42
let packed = pack([0, 1, 2, 3, 4])
//packed is [0x95, 0x00, 0x01, 0x02, 0x03, 0x04]
...
//you can find more examples in Tests folder
Installation
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/antonmes/MessagePack.git", majorVersion: 0, minor: 2)
]
)
Community
Join us on Slack.
License
MessagePack is released under the MIT license. See LICENSE for details.