{"id":20254806,"url":"https://github.com/chippyash/logicgate","last_synced_at":"2026-05-11T00:47:35.257Z","repository":{"id":196719732,"uuid":"696608721","full_name":"chippyash/logicgate","owner":"chippyash","description":"Builds on [Kelindar's Bitmap library](github.com/kelindar/bitmap) to provide:  - functional equivalents to the bitmap declarative methods  - additional functions for some 'missing' methods  - some utility functions that wouldn't make it into the Bitmap library","archived":false,"fork":false,"pushed_at":"2023-09-29T13:28:09.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T17:18:03.913Z","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/chippyash.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":"2023-09-26T05:03:08.000Z","updated_at":"2023-09-26T15:50:08.000Z","dependencies_parsed_at":"2024-11-14T10:45:11.217Z","dependency_job_id":null,"html_url":"https://github.com/chippyash/logicgate","commit_stats":null,"previous_names":["chippyash/logicgate"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/chippyash/logicgate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chippyash%2Flogicgate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chippyash%2Flogicgate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chippyash%2Flogicgate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chippyash%2Flogicgate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chippyash","download_url":"https://codeload.github.com/chippyash/logicgate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chippyash%2Flogicgate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32877246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-11-14T10:34:59.204Z","updated_at":"2026-05-11T00:47:35.237Z","avatar_url":"https://github.com/chippyash.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e  \u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"logic-gate.png\" alt=\"Logic Gates\"\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://img.shields.io/github/go-mod/go-version/chippyash/logicgate\" alt=\"Go Version\"\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/chippyash/logicgate\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/chippyash/logicgate\" alt=\"PkgGoDev\"\u003e\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/chippyash/logicgate\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/chippyash/logicgate\" alt=\"Go Report Card\"\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/chippyash/logicgate?branch=master\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/chippyash/logicgate/badge.svg?branch=master\" alt=\"Coverage Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Logic Gates\n## github.com/chippyash/logicgate\n\n## What\nBuilds on [Kelindar's Bitmap library](github.com/kelindar/bitmap) to provide:\n - functional equivalents to the bitmap declarative methods\n - additional functions for some 'missing' methods\n - some utility functions that wouldn't make it into the Bitmap library\n\n## Why\nTo provide the ability to write code functionally using bitmaps. Parameters\nto the functions are not changed, maintaining immutability.\n\nTo show that it is reasonably possible to take someone else's code and provide a different experience without harming\nthe originator.\n\nKelindar's Bitmap library allows for very large bitmaps. His primary use case is categorisation, for which bit maps\nare a good candidate, particularly if you are trying to slim down your data storage. My use case was slightly different,\nbut Kelindar's Bitmap serves the purpose as a highly efficient implementation.\n\nThe `bit` that was missing was the ability to compare bitmaps.\n\n## How\n\n - Go 1.18+  The base version is dictated by the Bitmap library. This may change in the future.\n - `import \"github.com/chippyash/logicgate\"`\n - Read the unit tests to see how functions are used\n - Run the examples/main.go program for example usage\n\n### Bitmap functional equivalents\n\n - func And(a, b bitmap.Bitmap) bitmap.Bitmap\n - func Or(a, b bitmap.Bitmap) bitmap.Bitmap\n - func Xor(a, b bitmap.Bitmap) bitmap.Bitmap\n\n### Additional functions\n\n - func Imply(a, b bitmap.Bitmap) bitmap.Bitmap\n - func Nimply(a, b bitmap.Bitmap) bitmap.Bitmap\n - func Nand(a, b bitmap.Bitmap) bitmap.Bitmap\n - func Not(a bitmap.Bitmap) bitmap.Bitmap\n - func Xnor(a, b bitmap.Bitmap) bitmap.Bitmap\n\n### Utility functions\n\n - func Compare(a, b bitmap.Bitmap) int\n - func RangeAll(src bitmap.Bitmap, fn func(k uint32, v bool))\n - func Trim(a bitmap.Bitmap, bitLen uint32) bitmap.Bitmap\n\n### An example of what you can do\nMy first use for Bitmap was to categorise team games by the players in the team, the objective being to ensure that I \nhadn't gotten the same players playing together too often.  That's where I hit a roadblock with Bitmap, it had no comparator.\nIn a sense, this library is a response to that. But once down the rabbit hole, off we must go!\n\n`examples/full_adder/main.go` is a purely contrived attempt to produce a bitmap oriented electronic circuit as described in\nhttps://en.wikipedia.org/wiki/Adder_(electronics)  It has no functional reason to exist, as there are far better ways to do\nthese things. It exists only as a demonstration of the art of the possible.\n\n\n## Contributing\n\nFeel free to submit a pull request to make changes or add functionality.  Please ensure that\nchanges are accompanied by relevant unit tests. I am particularly interested in efficiency improvements\nif you can make them, or edge cases if you find them, and of course `the art of the possible` as examples that others may \nlearn from.\n\nI cannot fix issues in the dependency chain. Please refer to the authors of a dependency.\n\n### Developing\n\n - clone the repo\n - `go get -u ./...`\n\n## References\n[Logic Gates](https://en.wikipedia.org/wiki/Logic_gate)\n\n## License\nThe library is licensed under the [MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchippyash%2Flogicgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchippyash%2Flogicgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchippyash%2Flogicgate/lists"}