deltarun
v0.0.1
Published
Delta Run-Length Encoding
Downloads
8
Maintainers
Readme
deltarun
Combines Delta and Run-Length Encoding
install
npm install deltarun
basic usage
import { encode, decode } from "deltarun"
const nums = [4326, 4327, 4329, 4339, 4341, 4343, 4345, 4347, 4349, 4351, ... many more numbers ]
encode(nums)
[1, 4326, 1, 1, 1, 2, 1, 10, 22, 2, 1, 3, 2, 2, 25, 1, 1, 2, 17, 1]
decode([1, 4326, 1, 1, 1, 2, 1, 10, 22, 2, 1, 3, 2, 2, 25, ...])
[4326, 4327, 4329, 4339, 4341, 4343, 4345, 4347, 4349, 4351, ...]
advanced usage
import { encode_str, decode_str } from "deltarun"
const nums = [4326, 4327, 4329, 4339, 4341, 4343, 4345, 4347, 4349, 4351, ... many more numbers ]
encode_str(nums)
"4326,1,2,10,2x22,3,2x2,1x25,2,1x17,..."
decode_str("4326,1,2,10,2x22,3,2x2,1x25,2,1x17,...")
[4326, 4327, 4329, 4339, 4341, 4343, 4345, 4347, 4349, 4351, ...]