- Notifications
You must be signed in to change notification settings - Fork1
🔧 Arithmetic coding algorithm implemented in Node.js, both API and CLI support. 算术编码 npm 包,支持 API 调用和 CLI。
License
NotificationsYou must be signed in to change notification settings
upupming/arithmetic-coding
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
- English Documentation
- Chinese Documentation
Install as module for API usage:
npmiarithmetic-coding
Or install as global CLI:
npmi-garithmetic-coding
From file path:
constariCoding=require('arithmetic-coding');// Encode from fileariCoding.encode(path.resolve('/txt/long.txt'),path.resolve('/txt/long-encoded.txt'));// Decode from fileariCoding.decode(path.resolve('/txt/long-encoded.txt'),path.resolve('/txt/long-decoded.txt'));
FromBuffer:
letdata=Buffer.from('Example data','utf8');// Encode from Bufferletencoded=encode.encodeFromBuffer(data);console.log(`encoded =${encoded}`);// Decode from Bufferletdecoded=decode.decodeFromBuffer(encoded);console.log(`decoded =${decoded}`);
$ari-coding-hUsage:index[options][command]Options:-v,--versionoutputtheversionnumber-h,--helpoutputusageinformationCommands:encode|e[options]<file>encodeafiledecode|d[options]<file>decodeafile$ari-codingencode-hUsage:encode|e[options]<file>encodeafileOptions:-o,--output<file>outputfilepath-h,--helpoutputusageinformation
You can see the latesttravis 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 |
About
🔧 Arithmetic coding algorithm implemented in Node.js, both API and CLI support. 算术编码 npm 包,支持 API 调用和 CLI。
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.