项目作者: bmshamsnahid

项目描述 :
npm Module for Run length encoding decoding algorithm.
高级语言: JavaScript
项目地址: git://github.com/bmshamsnahid/Run-Length-Encoder-Decoder.git
创建时间: 2018-03-05T16:41:16Z
项目社区:https://github.com/bmshamsnahid/Run-Length-Encoder-Decoder

开源协议:

下载


Run Length Encoder Decoder

A small library that endcode and decode words using Run Length Algorithm

Installation

npm i run-length-encoder-decoder --save

Usage

  1. let runLengthEncoderDecoder = require('run-length-encoder-decoder');
  2. runLengthEncoderDecoder.encoder('aabbcccaaaaa', (err, result) => {
  3. if (err) {
  4. console.log(err);
  5. } else {
  6. console.log('Encode: ' + result);
  7. runLengthEncoderDecoder.decoder(result, (err, result) => {
  8. if (err) {
  9. console.log(err);
  10. } else {
  11. console.log('Decode: ' + result);
  12. }
  13. });
  14. }
  15. });

Encoder Output should be a2b2c3a5
Decoder Output should be aabbcccaaaaa