Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arithmetic-coding

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arithmetic-coding

Arithmetic coding implementation

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

arithmetic-coding

travis build status License Coveralls npm

Installation

Install as module for API usage:

npm i arithmetic-coding

Or install as global CLI:

npm i -g arithmetic-coding

API

From file path:

const ariCoding = require('arithmetic-coding');
// Encode from file
ariCoding.encode(__dirname + '/txt/long.txt', __dirname + '/txt/long-encoded.txt');
// Decode from file
ariCoding.decode(__dirname + '/txt/long-encoded.txt', __dirname + '/txt/long-decoded.txt');

From Buffer:

let data = Buffer.from('Example data', 'utf8');
// Encode from Buffer
let encoded = encode.encodeFromBuffer(data);
console.log(`encoded = ${encoded}`);
// Decode from buffer
let decoded = decode.decodeFromBuffer(encoded);
console.log(`decoded = ${decoded}`);

Command-line interface

$ ari-coding -h
Usage: index [options] [command]

Options:
  -v, --version              output the version number
  -h, --help                 output usage information

Commands:
  encode|e [options] <file>  encode a file
  decode|d [options] <file>  decode a file

About the algorithm

  1. Wikipedia
  2. How to implement practical encoder/decoder
  3. Reference-arithmetic-coding on GitHub

Keywords

FAQs

Package last updated on 29 Mar 2019

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc