{"id":16699842,"url":"https://github.com/malcommac/swiftmsgpack","last_synced_at":"2025-08-09T16:06:54.406Z","repository":{"id":41454802,"uuid":"83199389","full_name":"malcommac/SwiftMsgPack","owner":"malcommac","description":"💬 Fast \u0026 Lightweight MsgPack Serializer \u0026 Deserializer for Swift","archived":false,"fork":false,"pushed_at":"2021-06-25T08:47:39.000Z","size":462,"stargazers_count":154,"open_issues_count":3,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-09T15:19:38.092Z","etag":null,"topics":["msgpack","serialization","serialize-objects","serializer","swift-library"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malcommac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-26T10:08:26.000Z","updated_at":"2024-01-09T13:11:09.000Z","dependencies_parsed_at":"2022-09-24T14:51:38.589Z","dependency_job_id":null,"html_url":"https://github.com/malcommac/SwiftMsgPack","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftMsgPack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftMsgPack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftMsgPack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftMsgPack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malcommac","download_url":"https://codeload.github.com/malcommac/SwiftMsgPack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225110575,"owners_count":17422411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["msgpack","serialization","serialize-objects","serializer","swift-library"],"created_at":"2024-10-12T18:08:21.570Z","updated_at":"2024-11-18T01:04:27.541Z","avatar_url":"https://github.com/malcommac.png","language":"Swift","readme":"\u003cp align=\"center\" \u003e\n  \u003cimg src=\"banner.png\" width=300px alt=\"SwiftLocation\" title=\"SwiftLocation\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eIt's like JSON, but faster!\u003c/strong\u003e\u003c/p\u003e\n\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CI Status](https://travis-ci.org/malcommac/SwiftMsgPack.svg)](https://travis-ci.org/malcommac/SwiftMsgPack) [![Version](https://img.shields.io/cocoapods/v/SwiftMsgPack.svg?style=flat)](http://cocoadocs.org/docsets/SwiftMsgPack) [![License](https://img.shields.io/cocoapods/l/SwiftMsgPack.svg?style=flat)](http://cocoadocs.org/docsets/SwiftMsgPack) [![Platform](https://img.shields.io/cocoapods/p/SwiftMsgPack.svg?style=flat)](http://cocoadocs.org/docsets/SwiftMsgPack)\n\n## What's this?\n\n[MessagePack](http://msgpack.org/) is an efficient binary serialization format, which lets you exchange data among multiple languages like JSON, except that it's [faster and smaller](http://theburningmonk.com/2011/12/performance-test-binary-serializers-part-ii). Small integers are encoded into a single byte while typical short strings require only one extra byte in addition to the strings themselves.  \nYou can read more about [specs directly from the main web](https://github.com/msgpack/msgpack/blob/master/spec.md) site.  \nMoreover it's made in pure Swift, no dependencies, lightweight \u0026 fully portable\n\n## Your Support\n\n*Hi fellow developer!*  \nYou know, maintaing and developing tools consumes resources and time. While I enjoy making them **your support is foundamental to allow me continue its development**.  \n\nIf you are using SwiftLocation or any other of my creations please consider the following options:\n\n- [**Make a donation with PayPal**](https://www.paypal.com/paypalme/danielemargutti/20)\n- [**Become a Sponsor**](https://github.com/sponsors/malcommac)\n\n- [⭐️ Follow Me \u0026 Discover Other Projects](https://github.com/malcommac)\n\n## Index\n* **[How to use](#howto)**\n* **[Supported Types](#supportedtypes)**\n* **[Installation (CocoaPods, SwiftPM and Carthage)](#installation)**\n* **[Tests](#tests)**\n\n\u003ca name=\"howto\" /\u003e\n\n## How to use: one-shot pack \u0026 unpack\n\nBoth serialization and deseralization happens inside a `Data` object.\n\nIn order to pack one or more objects you need to create an empty `Data` instance and call `pack` by passing the object(s) you want to serialize.\nIt's pretty easy, take a look here:\n\n```swift\nvar data = Data()\ndo {\n  let obj1 = \"Hello World\"\n  let obj2 = 45.5\n  let obj3: [AnyHashable:Any?] = [ \"key_1\" : \"value test\",\"key_2\" : 4,\"key_3\" : true, otherHashableKey: \"value1\"]\n  // Now you can pack your instances by passing them to pack function\n  try data.pack(obj1,obj2,obj3)\n} catch {\n  print(\"Something went wrong while packing data: \\(error)\")\n}\n```\n\nDeserializing data is pretty simple too, just call `unpack` function to an instance of `Data` with msgpack data:\n\n```swift\nlet data: Data = // msgpack data...\ndo {\n  let decodedObj: Any? = try data.unpack()\n} catch {\n  print(\"Something went wrong while unpacking data: \\(error)\")\n}\n```\n\n\u003ca name=\"supportedtypes\" /\u003e\n\n## Supported Types\n\nSwiftMsgPack supports the following Swift types:\n- `String`\n- `Data`\n- `Bool`\n- `nil`\n- Numeric values: `Int` \u0026 `UInt` (`UInt8`,`Int8`,`UInt16`,`Int16`,`UInt32`,`Int32`,`UInt64`,`Int64`), `Float` and `Double`\n- `Dictionaries` (`[AnyHashable:Any?]`)\n- `Array` (`[Any?]`)\n\nThe following limitations are specified by [MsgPack specs format](https://github.com/msgpack/msgpack/blob/master/spec.md#types-limitation):\n\n* a value of an Integer object is limited from `-(2^63)` upto `(2^64)-1`\n* maximum length of a Binary object is `(2^32)-1`\n* maximum byte size of a String object is `(2^32)-1`\n* String objects may contain invalid byte sequence and the behavior of a deserializer depends on the actual implementation when it received invalid byte sequence\n    * Deserializers should provide functionality to get the original byte array so that applications can decide how to handle the object\n* maximum number of elements of an Array object is `(2^32)-1`\n* maximum number of key-value associations of a Map object is `(2^32)-1`\n\n\u003ca name=\"installation\" /\u003e\n\n## Installation\nYou can install Swiftline using CocoaPods, carthage and Swift package manager\n\n### CocoaPods\n    use_frameworks!\n    pod 'SwiftMsgPack'\n\n### Carthage\n    github 'malcommac/SwiftMsgPack'\n\n### Swift Package Manager\nAdd swiftline as dependency in your `Package.swift`\n\n```\nimport PackageDescription\n\nlet package = Package(name: \"YourPackage\",\n  dependencies: [\n    .Package(url: \"https://github.com/malcommac/SwiftMsgPack.git\", majorVersion: 0),\n  ]\n)\n```\n\n\u003ca name=\"tests\" /\u003e\n\n## Tests\n\nSwiftMsgPack has an extensive coverage using XCTest.\nYou can found a complete list of tests inside `Tests/SwiftMsgPackTests` folder.\nTests can also be runned with XCode using the SwiftMsgPack project.\n\n\u003ca name=\"credits\" /\u003e\n\n## Contributing\n\n- If you **need help** or you'd like to **ask a general question**, open an issue.\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Copyright \u0026 Acknowledgements\n\nSwiftLocation is currently owned and maintained by Daniele Margutti.  \nYou can follow me on Twitter [@danielemargutti](http://twitter.com/danielemargutti).  \nMy web site is [https://www.danielemargutti.com](https://www.danielemargutti.com) \n\nThis software is licensed under [MIT License](LICENSE.md).\n\n***Follow me on:***  \n- 💼 [Linkedin](https://www.linkedin.com/in/danielemargutti/)  \n- 🐦 [Twitter](https://twitter.com/danielemargutti)\n","funding_links":["https://www.paypal.com/paypalme/danielemargutti/20","https://github.com/sponsors/malcommac"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcommac%2Fswiftmsgpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalcommac%2Fswiftmsgpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcommac%2Fswiftmsgpack/lists"}