{"id":16572834,"url":"https://github.com/lemire/cbitset","last_synced_at":"2025-04-05T03:09:06.905Z","repository":{"id":49964278,"uuid":"57926295","full_name":"lemire/cbitset","owner":"lemire","description":"A simple bitset library in C","archived":false,"fork":false,"pushed_at":"2025-02-24T20:06:53.000Z","size":83,"stargazers_count":134,"open_issues_count":1,"forks_count":18,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T02:05:26.613Z","etag":null,"topics":["bitset","bitset-library","c"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemire.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}},"created_at":"2016-05-02T22:54:03.000Z","updated_at":"2025-03-23T13:50:07.000Z","dependencies_parsed_at":"2023-11-30T03:27:58.453Z","dependency_job_id":"d1a5776e-7430-434c-8159-7a706aaf7859","html_url":"https://github.com/lemire/cbitset","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fcbitset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fcbitset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fcbitset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemire%2Fcbitset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemire","download_url":"https://codeload.github.com/lemire/cbitset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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":["bitset","bitset-library","c"],"created_at":"2024-10-11T21:28:41.137Z","updated_at":"2025-04-05T03:09:06.882Z","avatar_url":"https://github.com/lemire.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# cbitset\n![Ubuntu 20.04 CI (GCC 9)](https://github.com/lemire/cbitset/workflows/Ubuntu%2020.04%20CI%20(GCC%209)/badge.svg)\n![MSYS2-CI](https://github.com/lemire/cbitset/workflows/MSYS2-CI/badge.svg)\n![Visual Studio-CI](https://github.com/lemire/cbitset/workflows/VS16-CI/badge.svg)\n\nSimple bitset library in C. It includes fast functions\nto compute cardinalities, unions, intersections...\n\n- It is tiny: it is made of three files (two header files and one source file).\n- It is tested.\n- It is fast.\n- It is straight C.\n\nUsage in C:\n```C\nbitset_t * b = bitset_create();\nbitset_set(b,10);\nbitset_get(b,10);// returns true\nbitset_free(b); // frees memory\n```\n\nAdvanced example:\n\n\n```C\n    bitset_t *b = bitset_create();\n    for (int k = 0; k \u003c 1000; ++k) {\n        bitset_set(b, 3 * k);\n    }\n    // We have bitset_count(b) == 1000.\n    // We have bitset_get(b, 3) is true\n    // You can iterate through the values:\n    size_t k = 0;\n    for (size_t i = 0; bitset_next_set_bit(b, \u0026i); i++) {\n        // You will have i == k\n        k += 3;\n    }\n    // We support a wide range of operations on two bitsets such as\n    // bitset_inplace_symmetric_difference(b1,b2);\n    // bitset_inplace_symmetric_difference(b1,b2);\n    // bitset_inplace_difference(b1,b2);// should make no difference\n    // bitset_inplace_union(b1,b2);\n    // bitset_inplace_intersection(b1,b2);\n    // bitsets_disjoint\n    // bitsets_intersect\n```\n\n## CMake\n\n```\nmkdir build\ncd build\ncmake ..\ncmake --build . --config Release  \nctest .\n```\n\nThe cmake build also supports installation. The header files will be installed in a distinct subdirectory (cbitset).\n\n\n## Old-school Makefiles\n\nTo run tests:\n```bash\nmake\n./unit\n```\n\n## Prerequisites\n\nC11-compatible compiler.\n\nVisual Studio now supports the [C11 and C17 standards](https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemire%2Fcbitset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemire%2Fcbitset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemire%2Fcbitset/lists"}