Socket
Socket
Sign inDemoInstall

bzip2-async

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bzip2-async

An async bzip2 decompressor.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
13.3 kB
Created
Weekly downloads
 

Readme

Source

This repository is a fork of https://github.com/antimatter15/bzip2.js that makes the functionality asynchronous.

It's actually pretty simple to use, you can pass your Uint8Array to the bzip2.array method to get a bit reader function. This bit reader function is what all the other methods, header, decompress, and simple use.

header(bitstream) quite obviously reads in the bzip2 file header. It returns a single number between 1 and 9 describing the block size, which is one of the arguments of decompress

decompress(bitstream, size[, len]) does the main decompression of a single block. It'll return -1 if it detects that it's the final block, otherwise it returns a string with the decompressed data. If you want to cap the output to a certain number of bytes, set the len argument.

simple(bitstream) is what you probably want to use, because it combines header and loops over decompress so that the entire file is decompressed and returned as a string.

array(typed_array) is the function that generates that mythical bitstream function from a standard Uint8Array which you can make from an array buffer with new Uint8Array(arraybuffer).

Keywords

FAQs

Last updated on 07 Feb 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc