{"id":18879334,"url":"https://github.com/azusfin/structures","last_synced_at":"2025-06-17T01:34:58.720Z","repository":{"id":143737512,"uuid":"471869499","full_name":"Azusfin/structures","owner":"Azusfin","description":"Implementations of Data Structures","archived":false,"fork":false,"pushed_at":"2022-03-21T04:54:01.000Z","size":182,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-31T02:43:56.319Z","etag":null,"topics":["bits","bytes","data-structures","structures","tree"],"latest_commit_sha":null,"homepage":"https://azusfin.github.io/structures","language":"TypeScript","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/Azusfin.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":"2022-03-20T03:29:20.000Z","updated_at":"2022-03-20T08:24:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"76ba90e0-0548-4c73-8efe-69a619409905","html_url":"https://github.com/Azusfin/structures","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azusfin%2Fstructures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azusfin%2Fstructures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azusfin%2Fstructures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azusfin%2Fstructures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azusfin","download_url":"https://codeload.github.com/Azusfin/structures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239841743,"owners_count":19705981,"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":["bits","bytes","data-structures","structures","tree"],"created_at":"2024-11-08T06:35:25.817Z","updated_at":"2025-02-20T13:05:19.277Z","avatar_url":"https://github.com/Azusfin.png","language":"TypeScript","readme":"# @azusfin/structures\n\u003e Implementations of Data Structures\n\n# API Documentation\nhttps://azusfin.github.io/structures\n\n# Table Of Contents\n- [BitSet](#bitset)\n- [Uint4Array](#uint4array)\n- [Int4Array](#int4array)\n\n## BitSet\nA static-length array to work with bytes in bit-level\n\n- [Init](#init-bitset)\n- [Set](#set-bit)\n- [Get](#get-bit)\n- [Flip](#flip-bit)\n- [Clear](#clear-bit)\n\n### Init BitSet\n```js\nimport { BitSet } from \"@azusfin/structures\"\n\nconst bitsAmount = 64\nconst bitSet = new BitSet(bitsAmount)\n```\n\n### Set Bit\n```js\nconst index = 31\nbitSet.set(index)\n```\n\n### Get Bit\n```js\nbitSet.get(31) // true\nbitSet.get(4) // false\n```\n\n### Flip BIt\n```js\nbitSet.flip(31)\nbitSet.flip(4)\n\nbitSet.get(31) // false\nbitSet.get(4) // true\n```\n\n### Clear Bit\n```js\nbitSet.clear(31)\nbitSet.clear(4)\n\nbitSet.get(31) // false\nbitSet.get(4) // false\n```\n\n## Uint4Array\nAn array where each element occupies 4 bit unsigned integer from 0 to 15\n\n- [Init](#init-uint4array)\n- [Set](#set-uint4array)\n- [Get](#get-uint4array)\n\n### Init Uint4Array\n```js\nimport { Uint4Array } from \"@azusfin/structures\"\n\nconst length = 8\nconst array = new Uint4Array(length)\n```\n\n### Set Uint4Array\n```js\nconst offset = 3\narray.set(offset, 12)\narray.set(1, 6)\narray.set(5, 3)\n```\n\n### Get Uint4Array\n```js\narray.get(offset) // 12\narray.get(1) // 6\narray.get(5) // 3\n```\n\n## Int4Array\nA subtype of Uint4Array with support of 4 bit signed integer from -8 to 7\n\n- [Init](#init-int4array)\n- [Set](#set-int4array)\n- [Get](#get-int4array)\n\n### Init Int4Array\n```js\nimport { Int4Array } from \"@azusfin/structures\"\n\nconst length = 8\nconst array = new Int4Array(length)\n```\n\n### Set Int4Array\n```js\nconst offset = 3\narray.set(offset, -4)\narray.set(1, -8)\narray.set(5, 3)\n```\n\n### Get Int4Array\n```js\narray.get(offset) // -4\narray.get(1) // -8\narray.get(5) // 3\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazusfin%2Fstructures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazusfin%2Fstructures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazusfin%2Fstructures/lists"}