1.0.0 • Published 3 years ago
nv-facutil-bitmask v1.0.0
nv-facutil-bitmask
install
- npm install nv-facutil-bitmask
usage
const {BitMask} = require("nv-facutil-bitmask")
example
var bm = new BitMask(100)
bm.get(10)
bm.set(10)
bm.get(10)
bm.set(15)
Array.from(bm)
bm.unset(10)
Array.from(bm)
/*
> bm.get(10)
0
> bm.set(10)
> bm.get(10)
1
>
>bm.set(15)
> Array.from(bm)
[ 10, 15 ]
>
> bm.size_
2
> bm.unset(10)
undefined
> Array.from(bm)
[ 15 ]
>
*/
API
- fac_bm.BitMask
METHODS
- get(index)
- set(index) //set to 1
- unset(index) //set to 0
- size_
LICENSE
- ISC
1.0.0
3 years ago