{"id":17190742,"url":"https://github.com/stestagg/bitfield","last_synced_at":"2026-01-06T04:41:09.971Z","repository":{"id":6500701,"uuid":"7741208","full_name":"stestagg/bitfield","owner":"stestagg","description":"Python fast integer set implementation","archived":false,"fork":false,"pushed_at":"2024-01-04T14:09:29.000Z","size":379,"stargazers_count":9,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T16:48:49.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stestagg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2013-01-21T21:59:52.000Z","updated_at":"2024-01-04T10:03:22.000Z","dependencies_parsed_at":"2024-12-02T20:44:46.108Z","dependency_job_id":"40a559a0-f6b3-4bcd-97f8-8bd98d552722","html_url":"https://github.com/stestagg/bitfield","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":"0.040000000000000036","last_synced_commit":"89218be1c2c1c2445553080027f763fbab933c96"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stestagg/bitfield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fbitfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fbitfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fbitfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fbitfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stestagg","download_url":"https://codeload.github.com/stestagg/bitfield/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fbitfield/sbom","scorecard":{"id":851980,"data":{"date":"2025-08-11","repo":{"name":"github.com/stestagg/bitfield","commit":"fdc394d41cca5741bcc0f373a803aceb57cab563"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/stestagg/bitfield/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/stestagg/bitfield/build.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:15","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:16","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:17","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T22:46:28.423Z","repository_id":6500701,"created_at":"2025-08-23T22:46:28.423Z","updated_at":"2025-08-23T22:46:28.423Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28221838,"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","status":"online","status_checked_at":"2026-01-06T02:00:07.049Z","response_time":56,"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":[],"created_at":"2024-10-15T01:23:48.046Z","updated_at":"2026-01-06T04:41:09.944Z","avatar_url":"https://github.com/stestagg.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"bitfield\n========\n\nA Cython implemented fast positive integer set implementation, optimised for sets of sequential numbers.\n\n__WARNING__ : The serialisation mechanism is not currently portable,  This will be fixed soon\n\nInstallation\n---------\n\n```\n$ sudo easy_install bitfield\n```\n\nUsage\n-----\n\n```python\n\u003e\u003e\u003e import bitfield\n\u003e\u003e\u003e field = bitfield.Bitfield()\n\u003e\u003e\u003e field.add(100)\n\u003e\u003e\u003e print list(field)\n[100L]\n\u003e\u003e\u003e second = bitfield.Bitfield([2, 100])\n\u003e\u003e\u003e list(field | second)\n[2L, 100L]\n\n\u003e\u003e\u003e second.add(10000)\n\u003e\u003e\u003e second.pickle()\n'BZ:x\\x9cca@\\x00\\x01\\x86Q0\\nF\\xc1(\\x18N\\x80\\x11\\x00e\\xe0\\x00\\x16'\n\n\u003e\u003e\u003e large=bitfield.Bitfield(random.sample(xrange(1000000), 500000)) # 500,000 items, randomly distributed\n\u003e\u003e\u003e len(large)\n500000\n\u003e\u003e\u003e len(large.pickle())\n125049  # 122KB\n\n\u003e\u003e\u003e large=bitfield.Bitfield(xrange(1000000)) # 1 million items, all sequential\n\u003e\u003e\u003e len(large)\n1000000\n\u003e\u003e\u003e len(large.pickle())\n36 # \u003c40 bytes\n```\n\nBitfields support most of the same operations/usage as regular sets, see the tests for examples.\n\nDesign\n------\n\nBitfield was designed to efficiently handle tracking large sets of items.\n\nThe main design goals were:\n * Space-efficient serialisation format\n * Fast membership tests and set differences\n\nInternally, bitfield achieves this using a page-compressed 1-d bitmap.  \n\nWithin a page, a number is recorded as being present in the set by setting the n-th bit to 1.\nI.e. the set([1]) is recorded as ...00000010b, while set([1,4]) would be ...00010010b.\n\nThis works well for small sets, but the size of the bitfield tends towards (highest set member)/8 bytes as the largest number in the set increases. \n\nTo counter this, the bit field is split into chunks of 1 page (usually 4k).  If a particular page is empty(no set members in that range) or full, \nthen the bitfield is discarded, and represented by an EMPTY or FULL flag.\n\nTo improve lookup times and simplify set comparison, the bitfield always indexes items from 0.  \nTherefore, a set with a single item of 1,000,000,000 isn't going to be as fast as it could be.  This was an intentional design decision.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstestagg%2Fbitfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstestagg%2Fbitfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstestagg%2Fbitfield/lists"}