{"id":19534866,"url":"https://github.com/newyaroslav/brotli-hpp","last_synced_at":"2026-03-06T02:13:58.398Z","repository":{"id":162735305,"uuid":"349741212","full_name":"NewYaroslav/brotli-hpp","owner":"NewYaroslav","description":"Brotli header-only C++ library","archived":false,"fork":false,"pushed_at":"2024-04-07T00:47:18.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-26T14:42:24.769Z","etag":null,"topics":["brotli","brotli-compression","compression","cpp","cpp-library","cpp11","header-only","http","response"],"latest_commit_sha":null,"homepage":"","language":"C++","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/NewYaroslav.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-20T14:03:57.000Z","updated_at":"2024-09-09T04:46:18.000Z","dependencies_parsed_at":"2025-04-26T14:35:59.124Z","dependency_job_id":"5b3f5655-87ff-4898-aa2d-2e80a6419d28","html_url":"https://github.com/NewYaroslav/brotli-hpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NewYaroslav/brotli-hpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fbrotli-hpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fbrotli-hpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fbrotli-hpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fbrotli-hpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NewYaroslav","download_url":"https://codeload.github.com/NewYaroslav/brotli-hpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NewYaroslav%2Fbrotli-hpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30159054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["brotli","brotli-compression","compression","cpp","cpp-library","cpp11","header-only","http","response"],"created_at":"2024-11-11T02:16:22.098Z","updated_at":"2026-03-06T02:13:58.355Z","avatar_url":"https://github.com/NewYaroslav.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# brotli-hpp\nBrotli header-only C++ library\n\n## Usage\n\n```cpp\n// Include the specific brotli headers your code needs, for example...\n#include \u003cbrotli/compress.hpp\u003e\n#include \u003cbrotli/decompress.hpp\u003e\n#include \u003cbrotli/version.hpp\u003e\n\n// All function calls must pass in a pointer of an \n// immutable character sequence (aka a string in C) and its size\nstd::string data = \"hello\";\nconst char * pointer = data.data();\nstd::size_t size = data.size();\n\n// Compress returns a std::string\nstd::string compressed_data = brotli::compress(pointer, size);\n\n// Decompress returns std::string and decode brotli\nconst char * compressed_pointer = compressed_data.data();\nstd::string decompressed_data = brotli::decompress(compressed_pointer, compressed_data.size());\n\n// Or like so\nstd::string compressed_data = brotli::compress(data);\nstd::string decompressed_data = brotli::decompress(compressed_data);\n\n```\n\nSee an example project for *Code::Blocks* here: */code-blocks/*\n\n## Dependencies\n\nBrotli compression is implemented using the *https://github.com/google/brotli* library. \nSee *https://github.com/google/brotli* for more details.\n\nTo compile, include brotli library files in the project:\n\n* *brotli/c/common/*\n* *brotli/c/dec/*\n* *brotli/c/enc/*\n* *brotli/c/include/brotli/*\n\n\n## Versioning\nThis library is semantically versioned using the */include/brotli/version.hpp* file. \nThis defines a number of macros that can be used to check the current major, minor, or patch versions, as well as the full version string.\n\nHere's how you can check for a particular version to use specific API methods\n\n```cpp\n#if BROTLI_HPP_VERSION_MAJOR \u003e 2\n// use version 2 api\n#else\n// use older verion apis\n#endif\n```\n\nHere's how to check the version string\n\n```cpp\nstd::cout \u003c\u003c \"version: \" \u003c\u003c BROTLI_HPP_VERSION_STRING \u003c\u003c \"/n\";\n// =\u003e version: 1.0.0\n```\n\nAnd lastly, mathematically checking for a specific version:\n\n```cpp\n#if BROTLI_HPP_VERSION_CODE \u003e 20001\n// use feature provided in v2.0.1\n#endif\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewyaroslav%2Fbrotli-hpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewyaroslav%2Fbrotli-hpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewyaroslav%2Fbrotli-hpp/lists"}