Skip to content

yifan-fun/bit-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Bit Array Library with ArrayBuffer

This library contains a JavaScript implementation of bit arrays. The library supports:

  • create by arrayBuffer and init by unit8Array
  • getting and setting

The bit array is continuous. The following example shows how to set and get individual bits within the array:

    /* typescript */
    import {BIT, BitArray} from 'bit-array-buffer';

    a = new BitArray(32);
    a.set(0, BIT.ON);
    a.set(31, BIT.OFF);
    a.get(30);
    /* javascript */
    import BitArray from 'bit-array-buffer';
    a = new BitArray(32);
    a.set(0, 1);
    a.set(31, 1);
    a.get(30);

Installation

    npm i bit-array-buffer

About

js bufferArray convert bit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published