arithmetic-coding
- English Documentation
- Chinese Documentation
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 = ;// Encode from fileariCoding;// Decode from fileariCoding;
From Buffer
:
let data = Buffer;// Encode from Bufferlet encoded = encode;console;// Decode from Bufferlet decoded = decode;console;
Command-line interface
$ ari-coding -hUsage: 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 $ ari-coding encode -hUsage: encode|e options <file> encode a file Options: -o --output <file> output file path -h --help output usage information
Performance
You can see the latest travis test for running time used by each test.
Some benchmarks are shown below:
File size (Bytes) | total time | encode time | decode time |
---|---|---|---|
60640 | 110ms | small | 110ms |
2130640 | 2940ms | 426ms | 2514ms |