{"id":18410655,"url":"https://github.com/vfk/bitfield","last_synced_at":"2025-04-12T22:46:32.715Z","repository":{"id":77516502,"uuid":"231570131","full_name":"VFK/Bitfield","owner":"VFK","description":"A Swift bitfield implementation compatible with BitTorrent specification","archived":false,"fork":false,"pushed_at":"2020-01-03T11:57:01.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-24T15:17:53.674Z","etag":null,"topics":["bitfield","bittorrent","spm","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/VFK.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":"2020-01-03T11:02:03.000Z","updated_at":"2024-04-09T09:18:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"716b4845-65c6-4943-83a7-8fbdb5b6f109","html_url":"https://github.com/VFK/Bitfield","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2FBitfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2FBitfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2FBitfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VFK%2FBitfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VFK","download_url":"https://codeload.github.com/VFK/Bitfield/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239092738,"owners_count":19580214,"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":["bitfield","bittorrent","spm","swift"],"created_at":"2024-11-06T03:33:14.017Z","updated_at":"2025-02-16T05:28:31.237Z","avatar_url":"https://github.com/VFK.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitfield\n\nA simple bitfield implementation written in Swift for use with Package Manager.\n\nCompatible with BitTorrent specifucation:\n\u003e \u003c...\u003e a bitfield representing the pieces that have been successfully downloaded. The high bit in the first byte corresponds to piece index 0. Bits that are cleared indicated a missing piece, and set bits indicate a valid and available piece. Spare bits at the end are set to zero.\n\n## Usage\n\n```swift\nimport Bitfield\n\nlet bitfield = Bitfield(size: 10)\n\nbitfield.set(atIndex: Int) // Sets bit at specified index to 1\nbitfield.unset(atIndex: Int) // Sets bit at specified index to 0\nbitfield.isSet(atIndex: Int) -\u003e Bool\n```\n\nTo access (or set directly) bitfield data use\n```swift\nbitfield.data {get set} // Swift Data type \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfk%2Fbitfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvfk%2Fbitfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfk%2Fbitfield/lists"}