{"id":23651441,"url":"https://github.com/athanclark/intset.js","last_synced_at":"2026-02-26T16:05:07.910Z","repository":{"id":208443955,"uuid":"721651229","full_name":"athanclark/intset.js","owner":"athanclark","description":"IntSet implementation for JavaScript","archived":false,"fork":false,"pushed_at":"2024-09-24T03:05:21.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T15:45:59.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/athanclark.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-11-21T13:52:56.000Z","updated_at":"2024-09-24T03:05:24.000Z","dependencies_parsed_at":"2024-10-24T19:08:10.250Z","dependency_job_id":"dd894f6b-e294-4781-b8d5-7e78d8db1e1e","html_url":"https://github.com/athanclark/intset.js","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"7f0d7c61763e8255cacb50d210f25d93c13745ba"},"previous_names":["athanclark/intset.js"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/athanclark/intset.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fintset.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fintset.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fintset.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fintset.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athanclark","download_url":"https://codeload.github.com/athanclark/intset.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fintset.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29863826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T08:51:08.701Z","status":"ssl_error","status_checked_at":"2026-02-26T08:50:19.607Z","response_time":89,"last_error":"SSL_read: 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-12-28T16:37:44.664Z","updated_at":"2026-02-26T16:05:07.864Z","avatar_url":"https://github.com/athanclark.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"IntSet.js\n===========\n\nThis library allows for an _\"efficient\"_ storage mechanism for positive `BigInt` values in\nJavaScript. It allows for basic set-theoretic operations, like union and intersection as well.\n\nUsage\n------\n\nYou can create a new set pretty easily:\n\n```js\nconst IntSet = require('intset');\n\nlet set = new IntSet();\n```\n\nYou can add elements to a set straightforward as well:\n\n```js\nset.add(5n);\n```\n\nAnd remove them the same:\n\n```js\nset.remove(5n);\n```\n\nCheck for presence:\n\n```js\nconst is5inSet = set.contains(5n);\n```\n\nOr see if it's empty:\n\n```js\nconst isSetEmpty = set.isEmpty();\n```\n\nYou can also do typical set operations on them as well:\n\n```js\nconst set6 = set1\n    .union(set2)\n    .intersection(set3)\n    .symmetricDifference(set4)\n    .difference(set5);\n```\n\nImplementation\n-----------------\n\nInternally, the set is a series of BigInt's, where each one uses bit masking to determine the\npresence or lack thereof of other numbers. This allows a set that represents `n` numbers to\nactually take up `n / m` numbers of space, where `m` represents the amount of storage used\nper number. `m` defaults to `64` bits, as this has (through experimentation) seemed to be\nthe fastest, but can be customized through an argument to `new IntSet(customM)`.\n\nThis means that unions, intersections, and the like are implemented through bitwise\noperators on each masked number, rather than storing each number individually.\n\nContributing\n---------------\n\nJust make an issue, or file a pull request!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Fintset.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathanclark%2Fintset.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Fintset.js/lists"}