Binary Tools for JavaScript
JavaScript HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
docs Add RAR format docs from kthoom Feb 16, 2017
tests Name io-test consistently Feb 19, 2017
LICENSE Accidentally didn't add the updated files. Apr 20, 2016

bitjs: Binary Tools for JavaScript


A set of tools to handle binary data in JS (using Typed Arrays).

Example Usage

This namespace includes stream objects for reading and writing binary data at the bit and byte level: BitStream, ByteStream.

var bstream = new, true, offset, length); var crc = bstream.readBits(12); // read in 12 bits as CRC, advancing the pointer var flagbits = bstream.peekBits(6); // look ahead at next 6 bits, but do not advance the pointer


This namespace includes objects for unarchiving binary data in popular archive formats (zip, rar, tar) providing unzip, unrar and untar capabilities via JavaScript in the browser. The unarchive code depends on browser support of Web Workers. See the design doc.

``` function updateProgressBar(e) { ... update UI element ... } function displayZipContents(e) { ... display contents of the extracted zip file ... }

var unzipper = new bitjs.archive.Unzipper(zipFileArrayBuffer); unzipper.addEventListener("progress", updateProgressBar); unzipper.addEventListener("finish", displayZipContents); unzipper.start(); ```


This repository was automatically exported from and then I cherry-picked some commits from antimatter15's fork.