{"id":20178189,"url":"https://github.com/mattkrick/fast-bitset","last_synced_at":"2025-04-10T04:33:15.410Z","repository":{"id":57232880,"uuid":"41821877","full_name":"mattkrick/fast-bitset","owner":"mattkrick","description":"A fast bitset with some nice methods","archived":false,"fork":false,"pushed_at":"2023-03-17T11:03:12.000Z","size":45,"stargazers_count":36,"open_issues_count":6,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T05:43:56.314Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattkrick.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":"2015-09-02T19:02:56.000Z","updated_at":"2024-10-21T22:23:53.000Z","dependencies_parsed_at":"2024-06-18T20:12:31.696Z","dependency_job_id":null,"html_url":"https://github.com/mattkrick/fast-bitset","commit_stats":{"total_commits":49,"total_committers":5,"mean_commits":9.8,"dds":"0.40816326530612246","last_synced_commit":"14c7510ab4ebe1a4f8576b9c5d266f6e8a72a615"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Ffast-bitset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Ffast-bitset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Ffast-bitset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Ffast-bitset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattkrick","download_url":"https://codeload.github.com/mattkrick/fast-bitset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247853880,"owners_count":21007213,"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":[],"created_at":"2024-11-14T02:19:42.339Z","updated_at":"2025-04-10T04:33:15.388Z","avatar_url":"https://github.com/mattkrick.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fast-bitset\n\n[![Build Status](https://travis-ci.org/mattkrick/fast-bitset.svg?branch=master)](https://travis-ci.org/mattkrick/fast-bitset)\n\n[![Join the chat at https://gitter.im/mattkrick/fast-bitset](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mattkrick/fast-bitset?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nA fast bitset with some nice methods.\n\n##Features\n- Outperforms all other bitset packages in terms of speed and space\n- All bit operations execute in O(1) time (does not iterate through bits)\n- Useful methods for graph algorithms\n- Any array that stores booleans can safely be replaced by a bitset for improved speed\n- Uses 64x less space than a nontyped array\n\n##Installation\n `npm install fast-bitset --save`\n\n##License\nMIT\n\n##API\n\n* [BitSet](#BitSet)\n  * [new BitSet(nBitsOrKey)](#new_BitSet_new)\n  * [.get(idx)](#BitSet+get) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.set(idx)](#BitSet+set) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.setRange(from, to)](#BitSet+setRange) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.unset(idx)](#BitSet+unset) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.unsetRange(from, to)](#BitSet+unsetRange) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.toggle(idx)](#BitSet+toggle) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.toggleRange(from, to)](#BitSet+toggleRange) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.clear()](#BitSet+clear) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.clone()](#BitSet+clone) ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\n  * [.dehydrate()](#BitSet+dehydrate) ⇒ \u003ccode\u003estring\u003c/code\u003e\n  * [.and(bsOrIdx)](#BitSet+and) ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\n  * [.or(bsOrIdx)](#BitSet+or) ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\n  * [.xor(bsOrIdx)](#BitSet+xor) ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\n  * [.forEach(func)](#BitSet+forEach)\n  * [.circularShift(number)](#BitSet+circularShift) ⇒ \u003ccode\u003eBitset\u003c/code\u003e\n  * [.getCardinality()](#BitSet+getCardinality) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.getIndices()](#BitSet+getIndices) ⇒ \u003ccode\u003eArray\u003c/code\u003e\n  * [.isSubsetOf(bs)](#BitSet+isSubsetOf) ⇒ \u003ccode\u003eBoolean\u003c/code\u003e\n  * [.isEmpty()](#BitSet+isEmpty) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.isEqual(bs)](#BitSet+isEqual) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\n  * [.toString()](#BitSet+toString) ⇒ \u003ccode\u003estring\u003c/code\u003e\n  * [.ffs(_startWord)](#BitSet+ffs) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.ffz(_startWord)](#BitSet+ffz) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.fls(_startWord)](#BitSet+fls) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.flz(_startWord)](#BitSet+flz) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.nextSetBit(idx)](#BitSet+nextSetBit) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.nextUnsetBit(idx)](#BitSet+nextUnsetBit) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.previousSetBit(idx)](#BitSet+previousSetBit) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n  * [.previousUnsetBit(idx)](#BitSet+previousUnsetBit) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n\n\u003ca name=\"new_BitSet_new\"\u003e\u003c/a\u003e\n### new BitSet(nBitsOrKey)\nCreate a new bitset. Accepts either the maximum number of bits, or a dehydrated bitset\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| nBitsOrKey | \u003ccode\u003enumber\u003c/code\u003e \u0026#124; \u003ccode\u003estring\u003c/code\u003e | Number of bits in the set or dehydrated bitset. For speed and space concerns, the initial number of bits cannot be increased. |\n\n\u003ca name=\"BitSet+get\"\u003e\u003c/a\u003e\n### bitSet.get(idx) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nCheck whether a bit at a specific index is set\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if bit is set, else false  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the position of a single bit to check |\n\n\u003ca name=\"BitSet+set\"\u003e\u003c/a\u003e\n### bitSet.set(idx) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nSet a single bit\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if set was successful, else false  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the position of a single bit to set |\n\n\u003ca name=\"BitSet+setRange\"\u003e\u003c/a\u003e\n### bitSet.setRange(from, to) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nSet a range of bits\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if set was successful, else false  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| from | \u003ccode\u003enumber\u003c/code\u003e | the starting index of the range to set |\n| to | \u003ccode\u003enumber\u003c/code\u003e | the ending index of the range to set |\n\n\u003ca name=\"BitSet+unset\"\u003e\u003c/a\u003e\n### bitSet.unset(idx) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nUnset a single bit\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if set was successful, else false  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the position of a single bit to unset |\n\n\u003ca name=\"BitSet+unsetRange\"\u003e\u003c/a\u003e\n### bitSet.unsetRange(from, to) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nUnset a range of bits\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if set was successful, else false  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| from | \u003ccode\u003enumber\u003c/code\u003e | the starting index of the range to unset |\n| to | \u003ccode\u003enumber\u003c/code\u003e | the ending index of the range to unset |\n\n\u003ca name=\"BitSet+toggle\"\u003e\u003c/a\u003e\n### bitSet.toggle(idx) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nToggle a single bit\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if set was successful, else false  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the position of a single bit to toggle |\n\n\u003ca name=\"BitSet+toggleRange\"\u003e\u003c/a\u003e\n### bitSet.toggleRange(from, to) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nToggle a range of bits\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if set was successful, else false  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| from | \u003ccode\u003enumber\u003c/code\u003e | the starting index of the range to toggle |\n| to | \u003ccode\u003enumber\u003c/code\u003e | the ending index of the range to toggle |\n\n\u003ca name=\"BitSet+clear\"\u003e\u003c/a\u003e\n### bitSet.clear() ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nClear an entire bitset\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true  \n\u003ca name=\"BitSet+clone\"\u003e\u003c/a\u003e\n### bitSet.clone() ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\nClone a bitset\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e - an copy (by value) of the calling bitset  \n\u003ca name=\"BitSet+dehydrate\"\u003e\u003c/a\u003e\n### bitSet.dehydrate() ⇒ \u003ccode\u003estring\u003c/code\u003e\nTurn the bitset into a comma separated string that skips leading \u0026 trailing 0 words.\nEnds with the number of leading 0s and MAX_BIT.\nUseful if you need the bitset to be an object key (eg dynamic programming).\nCan rehydrate by passing the result into the constructor\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - representation of the bitset  \n\u003ca name=\"BitSet+and\"\u003e\u003c/a\u003e\n### bitSet.and(bsOrIdx) ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\nPerform a bitwise AND on 2 bitsets or 1 bitset and 1 index.\nBoth bitsets must have the same number of words, no length check is performed to prevent and overflow.\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e - a new bitset that is the bitwise AND of the two  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| bsOrIdx | \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e \u0026#124; \u003ccode\u003eNumber\u003c/code\u003e | a bitset or single index to check (useful for LP, DP problems) |\n\n\u003ca name=\"BitSet+or\"\u003e\u003c/a\u003e\n### bitSet.or(bsOrIdx) ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\nPerform a bitwise OR on 2 bitsets or 1 bitset and 1 index.\nBoth bitsets must have the same number of words, no length check is performed to prevent and overflow.\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e - a new bitset that is the bitwise OR of the two  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| bsOrIdx | \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e \u0026#124; \u003ccode\u003eNumber\u003c/code\u003e | a bitset or single index to check (useful for LP, DP problems) |\n\n\u003ca name=\"BitSet+xor\"\u003e\u003c/a\u003e\n### bitSet.xor(bsOrIdx) ⇒ \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e\nPerform a bitwise XOR on 2 bitsets or 1 bitset and 1 index.\nBoth bitsets must have the same number of words, no length check is performed to prevent and overflow.\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e - a new bitset that is the bitwise XOR of the two  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| bsOrIdx | \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e \u0026#124; \u003ccode\u003eNumber\u003c/code\u003e | a bitset or single index to check (useful for LP, DP problems) |\n\n\u003ca name=\"BitSet+forEach\"\u003e\u003c/a\u003e\n### bitSet.forEach(func)\nRun a custom function on every set bit. Faster than iterating over the entire bitset with a `get()`\nSource code includes a nice pattern to follow if you need to break the for-loop early\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| func | \u003ccode\u003efunction\u003c/code\u003e | the function to pass the next set bit to |\n\n\u003ca name=\"BitSet+circularShift\"\u003e\u003c/a\u003e\n### bitSet.circularShift(number) ⇒ \u003ccode\u003eBitset\u003c/code\u003e\nCircular shift bitset by an offset\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eBitset\u003c/code\u003e - a new bitset that is rotated by the offset  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| number | \u003ccode\u003eNumber\u003c/code\u003e | of positions that the bitset that will be shifted to the right. Using a negative number will result in a left shift. |\n\n\u003ca name=\"BitSet+getCardinality\"\u003e\u003c/a\u003e\n### bitSet.getCardinality() ⇒ \u003ccode\u003enumber\u003c/code\u003e\nGet the cardinality (count of set bits) for the entire bitset\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - cardinality  \n\u003ca name=\"BitSet+getIndices\"\u003e\u003c/a\u003e\n### bitSet.getIndices() ⇒ \u003ccode\u003eArray\u003c/code\u003e\nGet the indices of all set bits. Useful for debugging, uses `forEach` internally\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eArray\u003c/code\u003e - Indices of all set bits  \n\u003ca name=\"BitSet+isSubsetOf\"\u003e\u003c/a\u003e\n### bitSet.isSubsetOf(bs) ⇒ \u003ccode\u003eBoolean\u003c/code\u003e\nChecks if one bitset is subset of another. Same thing can be done using _and_ operation and equality check,\nbut then new BitSet would be created, and if one is only interested in yes/no information it would be a waste of memory\nand additional GC strain.\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eBoolean\u003c/code\u003e - `true` if provided bitset is a subset of this bitset, `false` otherwise  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| bs | \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e | a bitset to check |\n\n\u003ca name=\"BitSet+isEmpty\"\u003e\u003c/a\u003e\n### bitSet.isEmpty() ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nQuickly determine if a bitset is empty\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if the entire bitset is empty, else false  \n\u003ca name=\"BitSet+isEqual\"\u003e\u003c/a\u003e\n### bitSet.isEqual(bs) ⇒ \u003ccode\u003eboolean\u003c/code\u003e\nQuickly determine if both bitsets are equal (faster than checking if the XOR of the two is === 0).\nBoth bitsets must have the same number of words, no length check is performed to prevent and overflow.\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eboolean\u003c/code\u003e - true if the entire bitset is empty, else false  \n\n| Param | Type |\n| --- | --- |\n| bs | \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e |\n\n\u003ca name=\"BitSet+toString\"\u003e\u003c/a\u003e\n### bitSet.toString() ⇒ \u003ccode\u003estring\u003c/code\u003e\nGet a string representation of the entire bitset, including leading 0s (useful for debugging)\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - a base 2 representation of the entire bitset  \n\u003ca name=\"BitSet+ffs\"\u003e\u003c/a\u003e\n### bitSet.ffs(_startWord) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind first set bit (useful for processing queues, breadth-first tree searches, etc.)\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the first set bit in the bitset, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| _startWord | \u003ccode\u003enumber\u003c/code\u003e | the word to start with (only used internally by nextSetBit) |\n\n\u003ca name=\"BitSet+ffz\"\u003e\u003c/a\u003e\n### bitSet.ffz(_startWord) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind first zero (unset bit)\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the first unset bit in the bitset, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| _startWord | \u003ccode\u003enumber\u003c/code\u003e | the word to start with (only used internally by nextUnsetBit) |\n\n\u003ca name=\"BitSet+fls\"\u003e\u003c/a\u003e\n### bitSet.fls(_startWord) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind last set bit\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the last set bit in the bitset, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| _startWord | \u003ccode\u003enumber\u003c/code\u003e | the word to start with (only used internally by previousSetBit) |\n\n\u003ca name=\"BitSet+flz\"\u003e\u003c/a\u003e\n### bitSet.flz(_startWord) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind last zero (unset bit)\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the last unset bit in the bitset, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| _startWord | \u003ccode\u003enumber\u003c/code\u003e | the word to start with (only used internally by previousUnsetBit) |\n\n\u003ca name=\"BitSet+nextSetBit\"\u003e\u003c/a\u003e\n### bitSet.nextSetBit(idx) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind first set bit, starting at a given index\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the next set bit \u003e= idx, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the starting index for the next set bit |\n\n\u003ca name=\"BitSet+nextUnsetBit\"\u003e\u003c/a\u003e\n### bitSet.nextUnsetBit(idx) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind first unset bit, starting at a given index\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the next unset bit \u003e= idx, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the starting index for the next unset bit |\n\n\u003ca name=\"BitSet+previousSetBit\"\u003e\u003c/a\u003e\n### bitSet.previousSetBit(idx) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind last set bit, up to a given index\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the next unset bit \u003c= idx, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the starting index for the next unset bit (going in reverse) |\n\n\u003ca name=\"BitSet+previousUnsetBit\"\u003e\u003c/a\u003e\n### bitSet.previousUnsetBit(idx) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nFind last unset bit, up to a given index\n\n**Kind**: instance method of \u003ccode\u003e[BitSet](#BitSet)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - the index of the next unset bit \u003c= idx, or -1 if not found  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| idx | \u003ccode\u003enumber\u003c/code\u003e | the starting index for the next unset bit (going in reverse) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattkrick%2Ffast-bitset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattkrick%2Ffast-bitset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattkrick%2Ffast-bitset/lists"}