{"id":15007951,"url":"https://github.com/florianwendelborn/bitwise","last_synced_at":"2025-04-09T09:09:42.882Z","repository":{"id":32860909,"uuid":"36454720","full_name":"FlorianWendelborn/bitwise","owner":"FlorianWendelborn","description":":keycap_ten: JavaScript/TypeScript library to manipulate bits, nibbles, bytes, and buffers.","archived":false,"fork":false,"pushed_at":"2023-12-13T00:16:22.000Z","size":55216,"stargazers_count":81,"open_issues_count":8,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T09:09:37.384Z","etag":null,"topics":["bit-manipulation","bits","bitwise","buffer","byte","nibble","npm-package"],"latest_commit_sha":null,"homepage":"https://npmjs.org/package/bitwise","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/FlorianWendelborn.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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-05-28T17:29:37.000Z","updated_at":"2025-03-26T03:00:43.000Z","dependencies_parsed_at":"2023-12-13T01:27:45.758Z","dependency_job_id":"b72706aa-f60c-46a0-adb9-363ea0cae6ba","html_url":"https://github.com/FlorianWendelborn/bitwise","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianWendelborn%2Fbitwise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianWendelborn%2Fbitwise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianWendelborn%2Fbitwise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianWendelborn%2Fbitwise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlorianWendelborn","download_url":"https://codeload.github.com/FlorianWendelborn/bitwise/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"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":["bit-manipulation","bits","bitwise","buffer","byte","nibble","npm-package"],"created_at":"2024-09-24T19:14:36.112Z","updated_at":"2025-04-09T09:09:42.864Z","avatar_url":"https://github.com/FlorianWendelborn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ebitwise\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\tJavaScript/TypeScript library to manipulate bits, nibbles, bytes, and buffers.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/FlorianWendelborn/bitwise/actions/\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/FlorianWendelborn/bitwise/pipeline.yml?branch=main\u0026label=actions\u0026logo=github\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://codecov.io/gh/FlorianWendelborn/bitwise\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/FlorianWendelborn/bitwise/master.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://npmjs.com/package/bitwise\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/bitwise.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://npmjs.com/package/bitwise\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/bitwise.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://bundlephobia.com/result?p=bitwise\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/bitwise.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://npmjs.com/package/bitwise\"\u003e\u003cimg src=\"https://img.shields.io/badge/dependencies-none-success.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://bundlephobia.com/result?p=bitwise\"\u003e\u003cimg src=\"https://img.shields.io/badge/tree--shaking-ready-success.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://bundlephobia.com/result?p=bitwise\"\u003e\u003cimg src=\"https://img.shields.io/badge/side--effects-none-success.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://openbase.com/js/bitwise?utm_source=embedded\u0026utm_medium=badge\u0026utm_campaign=rate-badge\"\u003e\u003cimg src=\"https://badges.openbase.com/js/rating/bitwise.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://kandi.openweaver.com/typescript/FlorianWendelborn/bitwise\"\u003e\u003cimg src=\"https://kandi.openweaver.com/badges/xray.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Example\n\n```js\nimport bitwise from 'bitwise'\n\nconst bits = bitwise.byte.read(42)\n// [0, 0, 1, 0, 1, 0, 1, 0]\n\nbitwise.bits.toString(bits, 4)\n// '0010 1010'\n\nbitwise.byte.write(bits)\n// 42\n\nbitwise.bits.and([0, 0, 1, 1], [0, 1, 0, 1])\n// [0, 0, 0, 1]\n\nbitwise.bits.xor([0, 0, 1, 1], [0, 1, 0, 1])\n// [0, 1, 1, 0]\n\n// cherry-pick parts of bitwise\nimport byte from 'bitwise/byte'\nbyte.read(42)\n// [0, 0, 1, 0, 1, 0, 1, 0]\n```\n\n## Installation\n\n\u003cpre\u003e\n\u003ca href=\"https://bun.sh\"\u003ebun\u003c/a\u003e add bitwise\n\u003c/pre\u003e\n\nor\n\n\u003cpre\u003e\n\u003ca href=\"https://yarnpkg.com\"\u003eyarn\u003c/a\u003e add bitwise\n\u003c/pre\u003e\n\nor\n\n\u003cpre\u003e\n\u003ca href=\"https://npmjs.com\"\u003enpm\u003c/a\u003e install --save bitwise\n\u003c/pre\u003e\n\n## Table of Contents\n\n- [bits](#bits)\n  - operations ([and](#bitsand), [circularShiftLeft](#bitscircularshiftleft), [circularShiftRight](#bitscircularshiftright), [nand](#bitsnand), [nor](#bitsnor), [not](#bitsnot), [or](#bitsor), [xnor](#bitsxnor), [xor](#bitsxor))\n  - reduce operations ([reduceAnd](#bitsreduceand), [reduceNand](#bitsreducenand), [reduceNor](#bitsreducenor), [reduceOr](#bitsreduceor), [reduceXnor](#bitsreducexnor), [reduceXor](#bitsreducexor))\n  - [toString](#bitstostring)\n- [buffer](#buffer)\n  - [create](#buffercreate)\n  - [modify](#buffermodify)\n  - operations ([and](#bufferand), [nand](#buffernand), [nor](#buffernor), [not](#buffernot), [or](#bufferor), [xnor](#bufferxnor), [xor](#bufferxor))\n  - [read](#bufferread)\n  - [readInt](#bufferreadint)\n  - [readUInt](#bufferreaduint)\n- [byte](#byte)\n  - [read](#byteread)\n  - [write](#bytewrite)\n- [integer](#integer)\n  - [getBit](#integergetbit)\n  - [setBit](#integersetbit)\n  - [toggleBit](#integertogglebit)\n- [nibble](#nibble)\n  - [read](#nibbleread)\n  - [write](#nibblewrite)\n- [string](#string)\n  - [toBits](#stringtobits)\n\n## bits\n\n```js\n// cherry-pick\nimport and from 'bitwise/bits/and'\nimport bits from 'bitwise/bits'\nimport toString from 'bitwise/bits/to-string'\n```\n\n### bits.and\n\n```ts\n(bits1: Array\u003c0|1\u003e, bits2: Array\u003c0|1\u003e): Array\u003c0|1\u003e\n```\n\nApplies the bitwise `AND` operation, expects two arrays of the same size and returns a new one.\n\n```js\nbitwise.bits.and([1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0])\n// [0, 0, 0, 0, 0, 1, 0, 0]\n```\n\n### bits.circularShiftLeft\n\n```ts\n(bits: Array\u003c0|1\u003e, amount: number): Array\u003c0|1\u003e\n```\n\nApplies the bitwise `ROL` operation, expects two arrays of the same size and a shift amount and returns a new one.\n\n```js\nbitwise.bits.circularShiftLeft([0, 0, 0, 1, 1, 1, 1, 1], 1)\n// [0, 0, 1, 1, 1, 1, 1, 0]\n```\n\n### bits.circularShiftRight\n\n```ts\n(bits: Array\u003c0|1\u003e, amount: number): Array\u003c0|1\u003e\n```\n\nApplies the bitwise `ROR` operation, expects two arrays of the same size and a shift amount and returns a new one.\n\n```js\nbitwise.bits.circularShiftRight([0, 0, 0, 1, 1, 1, 1, 1], 1)\n// [1, 0, 0, 0, 1, 1, 1, 1]\n```\n\n### bits.nand\n\n```ts\n(bits1: Array\u003c0|1\u003e, bits2: Array\u003c0|1\u003e): Array\u003c0|1\u003e\n```\n\nApplies the bitwise `NAND` operation, expects two arrays of the same size and returns a new one.\n\n```js\nbitwise.bits.nand([1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0])\n// [1, 1, 1, 0, 1, 0, 0, 1]\n```\n\n### bits.nor\n\n```ts\n(bits1: Array\u003c0|1\u003e, bits2: Array\u003c0|1\u003e): Array\u003c0|1\u003e\n```\n\nApplies the bitwise `NOR` operation, expects two arrays of the same size and returns a new one.\n\n```js\nbitwise.bits.nor([1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0])\n// [1, 1, 1, 0, 1, 0, 0, 1]\n```\n\n### bits.not\n\n```ts\n(bits: Array\u003c0|1\u003e): Array\u003c0|1\u003e\n```\n\nFlips all given bits and returns the flipped bits.\n\n```js\nbitwise.bits.not([1, 0, 1, 1, 0, 1])\n// [0, 1, 0, 0, 1, 0]\n```\n\n### bits.or\n\n```ts\n(bits1: Array\u003c0|1\u003e, bits2: Array\u003c0|1\u003e): Array\u003c0|1\u003e\n```\n\nApplies the bitwise `OR` operation, expects two arrays of the same size and returns a new one.\n\n```js\nbitwise.bits.or([1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0])\n// [1, 1, 1, 0, 1, 1, 0, 1]\n```\n\n### bits.xnor\n\n```ts\n(bits1: Array\u003c0|1\u003e, bits2: Array\u003c0|1\u003e): Array\u003c0|1\u003e\n```\n\nApplies the bitwise exclusive `NOR` operation, expects two arrays of the same size and returns a new one.\n\n```js\nbitwise.bits.xnor([1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0])\n// [1, 1, 1, 0, 1, 0, 0, 1]\n```\n\n### bits.xor\n\n```ts\n(bits1: Array\u003c0|1\u003e, bits2: Array\u003c0|1\u003e): Array\u003c0|1\u003e\n```\n\nApplies the bitwise exclusive `OR` operation, expects two arrays of the same size and returns a new one.\n\n```js\nbitwise.bits.xor([1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0])\n// [1, 1, 1, 0, 1, 0, 0, 1]\n```\n\n### bits.reduceAnd\n\n```ts\n(bits: Array\u003c0|1\u003e): 0|1\n```\n\nApplies the bitwise `AND` operation on the given bits. Returns one bit. Throws if less than 2 bits are given.\n\n```js\nbitwise.bits.reduceAnd([1, 0, 0, 0, 1, 1, 0, 1])\n// 0\n```\n\n### bits.reduceNand\n\n```ts\n(bits: Array\u003c0|1\u003e): 0|1\n```\n\nApplies the `NAND` operation on the given bits. Returns one bit. Throws if less than 2 bits are given.\n\n```js\nbitwise.bits.reduceNand([1, 0, 0, 0, 1, 1, 0, 1])\n// 0\n```\n\n### bits.reduceNor\n\n```ts\n(bits: Array\u003c0|1\u003e): 0|1\n```\n\nApplies the `NOR` operation on the given bits. Returns one bit. Throws if less than 2 bits are given.\n\n```js\nbitwise.bits.reduceNor([1, 0, 0, 0, 1, 1, 0, 1])\n// 0\n```\n\n### bits.reduceOr\n\n```ts\n(bits: Array\u003c0|1\u003e): 0|1\n```\n\nApplies the `OR` operation on the given bits. Returns one bit.\nThrows if less than 2 bits are given.\n\n```js\nbitwise.bits.reduceOr([1, 0, 0, 0, 1, 1, 0, 1])\n// 1\n```\n\n### bits.reduceXnor\n\n```ts\n(bits: Array\u003c0|1\u003e): 0|1\n```\n\nApplies the `XNOR` operation on the given bits. Returns one bit. Throws if less than 2 bits are given.\n\n```js\nbitwise.bits.reduceXnor([1, 0, 0, 0, 1, 1, 0, 1])\n// 1\n```\n\n### bits.reduceXor\n\n```ts\n(bits: Array\u003c0|1\u003e): 0|1\n```\n\nApplies the `XOR` operation on the given bits. Returns one bit.\nThrows if less than 2 bits are given.\n\n```js\nbitwise.bits.reduceXor([1, 0, 0, 0, 1, 1, 0, 1])\n// 0\n```\n\n### bits.toBoolean\n\n```ts\n(bits: Array\u003c0|1\u003e): Array\u003cboolean\u003e\n```\n\nConverts a bit array to a boolean array.\n\n```js\nbitwise.bits.toBoolean([0, 1])\n// [false, true]\n```\n\n### bits.toString\n\n```ts\n(bits: Array\u003c0|1\u003e, spacing: number = 0, spacer: string = ' '): string\n```\n\nConverts a bit `Array` to a `String`. If defined, inserts `spacer` every `spacing` characters, but never inserts it as the last substring.\n\n```js\nbitwise.bits.toString([1, 0, 1, 0, 1, 0], 2, '_')\n// '10_10_10'\n```\n\n## buffer\n\n```js\n// cherry-pick\nimport and from 'bitwise/buffer/and'\nimport buffer from 'bitwise/buffer'\nimport create from 'bitwise/buffer/create'\n```\n\n### buffer.create\n\n```ts\n(bits: Array\u003c0|1\u003e): Buffer\n```\n\nCreates a new buffer and writes the given bits.\n\n```js\nconst buffer = bitwise.buffer.create([1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0])\n// Buffer(1111 0001 1010 0000)\n```\n\n### buffer.modify\n\n```ts\n(buffer: Buffer, newBits: Array\u003c0|1\u003e, bitOffset: number = 0): void\n```\n\nModifies the buffer's bits to equal `newBits` starting at `bitOffset`.\n\n```js\nconst buffer = Buffer.from('A43A', 'hex')\nbitwise.buffer.modify(buffer, [0, 0, 0, 1, 0, 0, 1], 3)\n// Buffer(1010 1001 0011 1010)\n```\n\n### buffer.and\n\n```ts\n(buffer1: Buffer, buffer2: Buffer, isLooping = false): Buffer\n```\n\nApplies a bitwise `AND` with `buffer2` to every value in `buffer1`. Returns a new buffer. If `isLooping` is set, `buffer1` may be read multiple times in case it's shorter than `buffer2`.\n\n```js\nbitwise.buffer.and(buffer1, buffer2, false)\n// Buffer(buffer1 AND buffer2)\n```\n\n### buffer.nand\n\n```ts\n(buffer1: Buffer, buffer2: Buffer, isLooping = false): Buffer\n```\n\nApplies a bitwise `NAND` with `buffer2` to every value in `buffer1`. Returns a new buffer. If `isLooping` is set, `buffer1` may be read multiple times in case it's shorter than `buffer2`.\n\n```js\nbitwise.buffer.nand(buffer1, buffer2, false)\n// Buffer(buffer1 NAND buffer2)\n```\n\n### buffer.nor\n\n```ts\n(buffer1: Buffer, buffer2: Buffer, isLooping = false): Buffer\n```\n\nApplies a bitwise `NOR` with `buffer2` to every value in `buffer1`. Returns a new buffer. If `isLooping` is set, `buffer1` may be read multiple times in case it's shorter than `buffer2`.\n\n```js\nbitwise.buffer.nor(buffer1, buffer2, false)\n// Buffer(buffer1 NOR buffer2)\n```\n\n### buffer.not\n\n```ts\n(buffer: Buffer): Buffer\n```\n\nFlips all bits in the given buffer.\n\n```js\nbitwise.buffer.not(buffer, false)\n// Buffer(NOT buffer)\n```\n\n### buffer.or\n\n```ts\n(buffer1: Buffer, buffer2: Buffer, isLooping = false): Buffer\n```\n\nApplies a bitwise `OR` with `buffer2` to every value in `buffer1`. Returns a new buffer. If `isLooping` is set, `buffer1` may be read multiple times in case it's shorter than `buffer2`.\n\n```js\nbitwise.buffer.or(buffer1, buffer2, false)\n// Buffer(buffer1 OR buffer2)\n```\n\n### buffer.xnor\n\n```ts\n(buffer1: Buffer, buffer2: Buffer, isLooping = false): Buffer\n```\n\nApplies a bitwise `XNOR` with `buffer2` to every value in `buffer1`. Returns a new buffer. If `isLooping` is set, `buffer1` may be read multiple times in case it's shorter than `buffer2`.\n\n```js\nbitwise.buffer.xnor(buffer1, buffer2, false)\n// Buffer(buffer1 XNOR buffer2)\n```\n\n### buffer.xor\n\n```ts\n(buffer1: Buffer, buffer2: Buffer, isLooping = false): Buffer\n```\n\nApplies a bitwise `XOR` with `buffer2` to every value in `buffer1`. Returns a new buffer. If `isLooping` is set, `buffer1` may be read multiple times in case it's shorter than `buffer2`.\n\n```js\nbitwise.buffer.xor(buffer1, buffer2, false)\n// Buffer(buffer1 XOR buffer2)\n```\n\n### buffer.read\n\n```ts\n(buffer: Buffer, bitOffset: number = 0, bitLength?: number): Array\u003c0|1\u003e\n```\n\nReturns an Array containing `bitLength` bits starting at `bitOffset`. If no `bitLength` is given, it's assumed to be the rest of the buffer.\n\n```js\nconst buffer = Buffer.from('ED743E17', 'hex')\nbitwise.buffer.read(buffer, 12)\n// [0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1]\n```\n\n### buffer.readInt\n\n```ts\n(buffer: Buffer, bitOffset: number = 0, bitLength: number = 8): number\n```\n\nConverts a section of a buffer to a signed integer.\n\n```js\n// buffer 11110110\nbitwise.buffer.readInt(buffer, 3, 5)\n// -10\n```\n\n### buffer.readUInt\n\n```ts\n(buffer: Buffer, bitOffset: number = 0, bitLength: number = 8): number\n```\n\nConverts a section of a buffer to an unsigned integer.\n\n```js\n// buffer 11110110\nbitwise.buffer.readUInt(buffer, 3, 5)\n// 22\n```\n\n## byte\n\n```js\n// cherry-pick\nimport byte from 'bitwise/byte'\nimport read from 'bitwise/byte/read'\n```\n\n### byte.read\n\n```ts\n(byte: UInt8): Array\u003c0|1\u003e\n```\n\nReturns an Array of length 8 containing the read bits.\n\n```js\nbitwise.byte.read(42)\n// [0, 0, 1, 0, 1, 0, 1, 0]\nbitwise.byte.read(256)\n// RangeError('invalid size')\n```\n\n### byte.write\n\n```ts\n(bits: Array\u003c0|1\u003e): UInt8\n```\n\nReturns a Byte (0-255) which represents the given bits.\n\n```js\nbitwise.byte.write([0, 0, 1, 0, 1, 0, 1, 0])\n// 42\nbitwise.byte.write([0, 0, 1, 0, 1, 0, 1, 0, 0])\n// RangeError('invalid array length')\n```\n\n## integer\n\n```js\n// cherry-pick\nimport integer from 'bitwise/integer'\n```\n\n### integer.getBit\n\n```ts\n(number: number, position: number): 0|1\n```\n\nGets the value of a specific bit.\n\n```js\nbitwise.integer.getBit(128, 7)\n// 1\n```\n\n### integer.setBit\n\n```ts\n(number: number, position: number, value: 0|1): Array\u003c0|1\u003e\n```\n\nSets the value of a specific bit.\n\n```js\nbitwise.integer.setBit(128, 7, 0)\n// 0\n```\n\n### integer.toggleBit\n\n```ts\n(number: number, position: number): Array\u003c0|1\u003e\n```\n\nToggles the value of a specific bit.\n\n```js\nbitwise.integer.toggleBit(128, 7)\n// 0\n```\n\n## nibble\n\n```js\n// cherry-pick\nimport nibble from 'bitwise/nibble'\nimport read from 'bitwise/nibble/read'\n```\n\n### nibble.read\n\n```ts\n(nibble: UInt4): Array\u003c0|1\u003e\n```\n\nReturns an Array of length 4 containing the read bits.\n\n```js\nbitwise.nibble.read(15)\n// [1, 1, 1, 1]\nbitwise.nibble.read(42)\n// RangeError('invalid size')\n```\n\n### nibble.write\n\n```ts\n(nibble: [\u003c0|1\u003e, \u003c0|1\u003e, \u003c0|1\u003e, \u003c0|1\u003e]): UInt4\n```\n\nReturns a Nibble (`0-15`) which represents the given bits.\n\n```js\nbitwise.nibble.write([0, 0, 1, 0])\n// 2\nbitwise.nibble.write([0, 0, 1, 0, 1])\n// RangeError('invalid array length')\n```\n\n## string\n\n```js\n// cherry-pick\nimport string from 'bitwise/string'\nimport toBits from 'bitwise/string/to-bits'\n```\n\n### string.toBits\n\n```ts\n(string: string): Array\u003c0|1\u003e\n```\n\nConverts a string into an array of bits. Ignores all characters except `1` and `0`.\n\n```js\nbitwise.string.toBits('10 10 12$%_.0')\n// [1, 0, 1, 0, 1, 0]\n```\n\n### Development\n\n`bitwise` uses [`bun`](https://bun.sh) instead of `node`\n\n```sh\n# install dependencies\nbun install\n\n# run tests\nbun test\n\n# build\nbun run build\n```\n\n## History\n\n### 2.2.1\n\n- remove `typescript` from `dependencies` in favor of `devDependencies`\n- (internal) update and apply prettier\n\n### 2.2.0\n\n- add npm provenance support to package\n- (internal) add auto-publish from pipelines\n- (internal) Switch to `bun`\n\n### 2.1.0\n\n- Add `bits.circularShiftLeft` (#44 / #49) via @0xflotus\n- Add `bits.circularShiftRight` (#44 / #49) via @0xflotus\n\n### 2.0.2–2.0.3\n\n- Add Support for Tree Shaking\n\n### 2.0.1\n\n- Readme/package.json updates\n\n### 2.0.0\n\n- refactor to typescript\n- remove `bitwise.buffer.readCInt()`\n\n### 1.4.0\n\n- improve `require()` support\n\n### 1.3.0\n\n- add `bits.toBoolean`\n\n### 1.2.0\n\n- add `bits.reduceAnd`\n- add `bits.reduceNand`\n- add `bits.reduceNor`\n- add `bits.reduceOr`\n- add `bits.reduceXnor`\n- add `bits.reduceXor`\n\n### 1.1.2\n\n- split up `buffer.operations`\n\n### 1.1.1\n\n- split up `bits.operations`\n\n### 1.1.0\n\n- add `integer.getBit`\n- add `integer.setBit`\n- add `integer.toggleBit`\n\n### 1.0.0\n\n- rewrite in ES6\n- improve utilization of bitwise operators\n- improve API (**breaking change**)\n\n### 0.2.0\n\n- Added buffer bitwise operations\n\n### 0.1.2\n\n- Added nor, xnor, nand\n- Fixed bitwise operations modifying original array\n\n### 0.1.0\n\n- **Re-ordered the arguments** in readInt, readCInt, readUInt\n- Added not, and, or, xor\n- Renamed flipBits to not\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianwendelborn%2Fbitwise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorianwendelborn%2Fbitwise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianwendelborn%2Fbitwise/lists"}