yarn add @vivaxy/vlq
or npm i @vivaxy/vlq
import { encode, decode } from '@vivaxy/vlq';
// encode
encode(0);
// decode
decode('A');
encode(input: number | number[]): string
decode(input: string): number[]
vlq#decode x 1,103,260 ops/sec ±0.62% (91 runs sampled)
@vivaxy/vlq#decode x 1,935,656 ops/sec ±0.47% (95 runs sampled)
Fastest is @vivaxy/vlq#decode
vlq#encode x 4,445,119 ops/sec ±0.91% (91 runs sampled)
@vivaxy/vlq#encode x 3,454,481 ops/sec ±0.76% (92 runs sampled)
Fastest is vlq#encode
(Project created by create-n.)