Socket
Book a DemoInstallSign in
Socket

minimal-bit-array

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimal-bit-array

Minimal bit array implementation that is compatible with ndarrays

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

minimal-bit-array

A minimalistic bit array implementation that is compatible with ndarray's internals.

testling badge

build status

Example

var BitArray = require("minimal-bit-array")
var x = new BitArray(100)

x.set(5, true)

console.log(x.get(4))     //Prints false
console.log(x.get(5))     //Prints true

Install

npm install minimal-bit-array

API

var BitArray = require("minimal-bit-array")

BitArray(length)

Creates a bit array with the given length

array.get(i)

Retrieves the bit at location i

array.set(i, v)

Sets the bit at location i to v

array.toJSON()

Serializes the array to a JSON object

BitArray.fromJSON(x)

Deserializes a JSON object into a bit array.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

bitarray

FAQs

Package last updated on 31 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts