This package has been deprecated

Author message:

The bitarray package is deprecated in favor of the BitSet ( https://www.npmjs.com/package/bitset ) library.

bitarray

2.1.0 • Public • Published

BitArray: A simple bit array/bit field library in pure JavaScript

BitArray is now depricated and aliased to BitSet.js. For full feature overview, consult the documentation.

The old API is still maintained for bitarray:

Examples

Create a bit array 1000 bits wide:

var ba = new BitArray(1000);

Setting and reading bits:

ba.set(100, 1);
ba.get(100); // => 1
 
ba.set(100, 0);
ba.get(100); // = > 0

More:

var ba = new BitArray(20);
[1,3,5,9,11,13,15].forEach(function(i){ ba.set(i, 1) });
ba.toString(); // => "01010100010101010000"

Copyright and licensing

Copyright (c) 2014-2018, Robert Eisele Dual licensed under the MIT or GPL Version 2 licenses.

Dependents (0)

Package Sidebar

Install

npm i bitarray

Weekly Downloads

20

Version

2.1.0

License

MIT

Unpacked Size

2.85 kB

Total Files

5

Last publish

Collaborators

  • infusion