{"id":22562239,"url":"https://github.com/preciz/abit","last_synced_at":"2025-04-10T10:33:18.154Z","repository":{"id":35134281,"uuid":"211094750","full_name":"preciz/abit","owner":"preciz","description":"Use :atomics as a bit array or as an array of N-bit counters","archived":false,"fork":false,"pushed_at":"2025-01-13T07:32:18.000Z","size":140,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T09:21:19.233Z","etag":null,"topics":["atomics","bitwise","elixir"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/abit","language":"Elixir","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/preciz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-09-26T13:22:46.000Z","updated_at":"2025-01-13T07:32:22.000Z","dependencies_parsed_at":"2024-07-19T22:51:39.001Z","dependency_job_id":"477c3646-173b-448d-bc4e-01fe8fb6458c","html_url":"https://github.com/preciz/abit","commit_stats":{"total_commits":152,"total_committers":3,"mean_commits":"50.666666666666664","dds":"0.11842105263157898","last_synced_commit":"4df99becfbf055436f3561efdc0c94512c8b1c47"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Fabit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Fabit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Fabit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preciz%2Fabit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preciz","download_url":"https://codeload.github.com/preciz/abit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"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":["atomics","bitwise","elixir"],"created_at":"2024-12-07T22:12:10.017Z","updated_at":"2025-04-10T10:33:18.129Z","avatar_url":"https://github.com/preciz.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Abit\n\n[![test](https://github.com/preciz/abit/actions/workflows/test.yml/badge.svg)](https://github.com/preciz/abit/actions/workflows/test.yml)\n\nUse `:atomics` as a bit array or as an array of N-bit counters.\n\nDocumentation can be found at [https://hexdocs.pm/abit](https://hexdocs.pm/abit).\n\n## Installation\n\n**Note**: it requires OTP-21.2.1 or later.\n\nAdd `abit` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:abit, \"~\u003e 0.3\"}\n  ]\nend\n```\n\n## API summary\nSee [https://hexdocs.pm/abit](https://hexdocs.pm/abit) for full documentation.\n\n### Abit - use `:atomics` as a bit array\n* `Abit.bit_count/1` - Returns count of bits in atomics.\n* `Abit.merge/2` - Merges bits of 2 atomics using Bitwise OR.\n* `Abit.intersect/2` - Intersects bits of 2 atomics using Bitwise AND.\n* `Abit.bit_position/1` - Returns the bit's position in an atomics array.\n* `Abit.bit_at/2` - Returns the bit at a given position from atomics.\n* `Abit.set_bit_at/3` - Sets the bit in atomics at the given position to the given bit (0 or 1).\n* `Abit.set_bits_count/1` - Returns the number of bits set to 1 in atomics.\n* `Abit.hamming_distance/2` - Returns the bitwise hamming distance between the 2 given atomics.\n### Abit.Counter - use `:atomics` as an array of N-bit counters\n* `Abit.Counter.new/2` - Create a new array of counters. Returns %Abit.Counter{} struct.\n* `Abit.Counter.get/2` - Returns the value of counter at the given index.\n* `Abit.Counter.put/3` - Puts the value into counter at the given index.\n* `Abit.Counter.add/3` - Adds the increment to counter at the given index.\n### Abit.Bitmask - helper functions for bitmasks\n* `Abit.Bitmask.set_bits_count/1` - Returns the number of bits set to 1 in the given integer.\n* `Abit.Bitmask.bit_at/2` - Returns the bit at a given position in the given integer.\n* `Abit.Bitmask.set_bit_at/3` - Sets a bit in the given integer at the given position to a given bit (0 or 1).\n* `Abit.hamming_distance/2` - Returns the bitwise hamming distance between the 2 given integers.\n\n\n## License\n\nAbit is [MIT licensed](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreciz%2Fabit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreciz%2Fabit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreciz%2Fabit/lists"}