{"id":15567608,"url":"https://github.com/purehyperbole/bitfield","last_synced_at":"2025-10-14T04:30:08.176Z","repository":{"id":114512639,"uuid":"350785754","full_name":"purehyperbole/bitfield","owner":"purehyperbole","description":"A basic variable length bit field implementation","archived":false,"fork":false,"pushed_at":"2021-03-23T17:12:30.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T19:07:40.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/purehyperbole.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":"2021-03-23T16:41:22.000Z","updated_at":"2021-03-23T17:12:32.000Z","dependencies_parsed_at":"2023-05-17T14:31:15.785Z","dependency_job_id":null,"html_url":"https://github.com/purehyperbole/bitfield","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/purehyperbole/bitfield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fbitfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fbitfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fbitfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fbitfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purehyperbole","download_url":"https://codeload.github.com/purehyperbole/bitfield/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fbitfield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017943,"owners_count":26086213,"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":"2025-10-14T02:00:06.444Z","response_time":60,"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-02T17:11:59.649Z","updated_at":"2025-10-14T04:30:08.160Z","avatar_url":"https://github.com/purehyperbole.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitfield\nA basic variable length bit field implementation ported from [this stack overflow answer](https://stackoverflow.com/a/177092)\n\n# Usage\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/purehyperbole/bitfield\"\n)\n\ntype Item int\n\nconst (\n    Eggs Item = iota\n    Milk\n    Sugar\n    Pasta\n    Cheese\n    Tomatoes\n)\n\nfunc (i Item) String() string {\n    return [...]string{\"Eggs\", \"Milk\", \"Sugar\", \"Pasta\", \"Cheese\", \"Tomatoes\"}[i]\n}\n\nfunc main() {\n    // creates a bitfield with 128 different possible flags\n    shoppingList := bitfield.New(16)\n\n    // set some flags\n    shoppingList.Set(Eggs)\n    shoppingList.Set(Pasta)\n    shoppingList.Set(Cheese)\n\n    for _, item := range []int{Eggs, Milk, Sugar, Pasta, Cheese, Tomatoes} {\n        // check if the list has flags\n        if shoppingList.Has(item) {\n            fmt.Println(\"need:\", item)\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurehyperbole%2Fbitfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurehyperbole%2Fbitfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurehyperbole%2Fbitfield/lists"}