{"id":28630875,"url":"https://github.com/aztecprotocol/msgpack-c","last_synced_at":"2025-06-12T13:08:59.116Z","repository":{"id":156224043,"uuid":"630907283","full_name":"AztecProtocol/msgpack-c","owner":"AztecProtocol","description":"Fork of msgpack-c repo with a few more safety checks","archived":false,"fork":false,"pushed_at":"2025-04-02T21:18:02.000Z","size":6164,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-05T23:36:17.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AztecProtocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-21T12:39:57.000Z","updated_at":"2025-04-02T21:18:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"56b96278-7cbe-47aa-bc0c-386ac5dffc27","html_url":"https://github.com/AztecProtocol/msgpack-c","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AztecProtocol/msgpack-c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Fmsgpack-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Fmsgpack-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Fmsgpack-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Fmsgpack-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AztecProtocol","download_url":"https://codeload.github.com/AztecProtocol/msgpack-c/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2Fmsgpack-c/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259470951,"owners_count":22862999,"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":[],"created_at":"2025-06-12T13:08:56.466Z","updated_at":"2025-06-12T13:08:59.098Z","avatar_url":"https://github.com/AztecProtocol.png","language":"C++","readme":"`msgpack` for C++\n===================\n\nVersion 6.1.0 [![Build Status](https://github.com/msgpack/msgpack-c/workflows/CI/badge.svg?branch=cpp_master)](https://github.com/msgpack/msgpack-c/actions) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/cpp_master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)\n[![codecov](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master/graph/badge.svg)](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master)\n\nIt's like JSON but smaller and faster.\n\nOverview\n--------\n\n[MessagePack](http://msgpack.org/) is an efficient binary serialization\nformat, which lets you exchange data among multiple languages like JSON,\nexcept that it's faster and smaller. Small integers are encoded into a\nsingle byte and short strings require only one extra byte in\naddition to the strings themselves.\n\nExample\n-------\n\n```c++\n#include \u003cmsgpack.hpp\u003e\n#include \u003cstring\u003e\n#include \u003ciostream\u003e\n#include \u003csstream\u003e\n\nint main()\n{\n    msgpack::type::tuple\u003cint, bool, std::string\u003e src(1, true, \"example\");\n\n    // serialize the object into the buffer.\n    // any classes that implements write(const char*,size_t) can be a buffer.\n    std::stringstream buffer;\n    msgpack::pack(buffer, src);\n\n    // send the buffer ...\n    buffer.seekg(0);\n\n    // deserialize the buffer into msgpack::object instance.\n    std::string str(buffer.str());\n\n    msgpack::object_handle oh =\n        msgpack::unpack(str.data(), str.size());\n\n    // deserialized object is valid during the msgpack::object_handle instance is alive.\n    msgpack::object deserialized = oh.get();\n\n    // msgpack::object supports ostream.\n    std::cout \u003c\u003c deserialized \u003c\u003c std::endl;\n\n    // convert msgpack::object instance into the original type.\n    // if the type is mismatched, it throws msgpack::type_error exception.\n    msgpack::type::tuple\u003cint, bool, std::string\u003e dst;\n    deserialized.convert(dst);\n\n    // or create the new instance\n    msgpack::type::tuple\u003cint, bool, std::string\u003e dst2 =\n        deserialized.as\u003cmsgpack::type::tuple\u003cint, bool, std::string\u003e \u003e();\n\n    return 0;\n}\n```\n\nSee [`QUICKSTART-CPP.md`](./QUICKSTART-CPP.md) for more details.\n\nDependency\n----------\n\nmsgpack-c requires [boost library](https://www.boost.org/).\nC++ version of msgpack-c itself is a header-only library and depends only on\nboost headers. Tests depend on boost unit test framework and are linked with\nit, so if you want to build them, you need to have this dependency installed.\n\nExperimental support for removing boost dependency\n\nFor cmake:\n\n```\ncmake -DMSGPACK_USE_BOOST=OFF ..\n```\n\nNOTE: `-DMSGPACK_BUILD_TESTS=ON` doesn't work with `-DMSGPACK_USE_BOOST=OFF`.\n\nFor C++ compiler\n\n```\nclang++ -DMSGPACK_NO_BOOST your_code.cpp\n```\n\n\nUsage\n-----\n\n- If you build your project with cmake, you can find msgpack-c with a\n  canonical cmake-way:\n\n  ```cmake\n  # ...\n  find_package(msgpack REQUIRED)\n  # ...\n  target_link_libraries(your_target_name \u003cPRIVATE/PUBLIC/INTERFACE\u003e msgpack-cxx)\n  # ...\n  ```\n\n  This will search for `msgpack` cmake package in a system prefix and in\n  prefixes from `CMAKE_PREFIX_PATH`. Note that msgpack-c depends on boost\n  headers, and `msgpack` cmake package depends on `Boost` cmake package. The\n  library is header-only and `target_link_libraries` command just adds path\n  to msgpack-c headers to your compiler's include path.\n\n  A usage example can be found at [test-install](test-install) directory.\n\n- If you do not use cmake, you can just add path yo msgpack-c and boost\n  headers to your include path:\n\n  ```bash\n  g++ -I msgpack-c/include -I path_to_boost your_source_file.cpp\n  ```\n\nBuilding and Installing\n-----------------------\n\n### Install from git repository\n\n#### Using the Terminal (CLI)\n\nYou will need:\n\n- `gcc \u003e= 4.1.0`\n- `cmake \u003e= 3.1.0`\n\nC++03:\n\n```bash\ngit clone https://github.com/msgpack/msgpack-c.git\ncd msgpack-c\ngit checkout cpp_master\ncmake .\nsudo cmake --build . --target install\n```\n\nIf you want to build tests with different C++ version, you can use\n`MSGPACK_CXX11`, `MSGPACK_CXX14`, `MSGPACK_CXX17`, `MSGPACK_CXX20` options.\nJust replace the line\n\n```bash\ncmake .\n```\n\nwith a line like that:\n\n```bash\ncmake -DMSGPACK_CXX20=ON .\n```\n\nNote that these flags do not affect installation. They just switch test cases.\nAll files are installed in every settings.\n\nIf you don't have superuser permissions or don't want to install the library\nto a system-wide prefix, you can use `CMAKE_INSTALL_PREFIX` option like that:\n\n```bash\ncmake -DCMAKE_INSTALL_PREFIX=/your/custom/prefix .\n```\n\nOther useful options:\n\n- `MSGPACK_BUILD_TESTS` (default `OFF`): build tests\n- `MSGPACK_BUILD_EXAMPLES` (default `OFF`): build examples\n- `MSGPACK_32BIT` (default `OFF`): 32bit compile\n- `MSGPACK_USE_X3_PARSE` (default `OFF`): use Boost X3 parse\n  (note that it requires C++14 or newer)\n- `MSGPACK_CHAR_SIGN` (not set explicitly by default): char sign to use (signed or unsigned)\n- `MSGPACK_USE_STATIC_BOOST` (default `OFF`): statically link with boost libraries\n\n#### GUI on Windows\n\nClone msgpack-c git repository with the command:\n\n```\ngit clone https://github.com/msgpack/msgpack-c.git\n```\n\nor using GUI git client (e.g. [tortoise git](https://code.google.com/p/tortoisegit/)).\n\n1. Checkout to `cpp_master` branch\n\n2. Launch [cmake GUI client](http://www.cmake.org/cmake/resources/software.html).\n\n3. Set 'Where is the source code:' text box and\n   'Where to build the binaries:' text box.\n\n4. Click 'Configure' button.\n\n5. Choose your Visual Studio version.\n\n6. Click 'Generate' button.\n\n7. Open the created msgpack.sln on Visual Studio.\n\n8. Build all.\n\nDocumentation\n-------------\n\nYou can get additional information including the tutorial on the\n[wiki](https://github.com/msgpack/msgpack-c/wiki).\n\nContributing\n------------\n\n`msgpack-c` is developed on GitHub at [msgpack/msgpack-c](https://github.com/msgpack/msgpack-c).\nTo report an issue or send a pull request, use the\n[issue tracker](https://github.com/msgpack/msgpack-c/issues).\n\nHere's the list of [great contributors](https://github.com/msgpack/msgpack-c/graphs/contributors).\n\nLicense\n-------\n\n`msgpack-c` is licensed under the Boost Software License, Version 1.0. See\nthe [`LICENSE_1_0.txt`](./LICENSE_1_0.txt) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faztecprotocol%2Fmsgpack-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faztecprotocol%2Fmsgpack-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faztecprotocol%2Fmsgpack-c/lists"}