fast-rle

0.1.0 • Public • Published

fast-rle

Fast Run Length Encoder and Decoder

usage

decoding

import decode from 'fast-rle/decode';

const encoded = [5, 3, 1, 8, 2, 0];
decode(encoded);
[3, 3, 3, 3, 3, 8, 0, 0]

encoding

import encode from 'fast-rle/encode';

const nums = [3, 3, 3, 3, 3, 8, 0, 0];
encode(nums);
[5, 3, 1, 8, 2, 0]

encode(nums, { chunk: true });
[ [3, 5], [8, 1], [0, 2] ]

encode(nums, { max_run_length: 2 });
[2, 3, 2, 3, 1, 3, 1, 8, 2, 0]

support

Post an issue at https://github.com/danieljdufour/fast-rle

Package Sidebar

Install

npm i fast-rle

Weekly Downloads

9

Version

0.1.0

License

CC0-1.0

Unpacked Size

9.57 kB

Total Files

6

Last publish

Collaborators

  • danieljdufour