@vivaxy/vlq

🔣Decode and encode Base64 VLQ.

Usage no npm install needed!

<script type="module">
  import vivaxyVlq from 'https://cdn.skypack.dev/@vivaxy/vlq';
</script>

README

@vivaxy/vlq

Build Status NPM Version NPM Downloads MIT License Standard Version Codecov

Install

yarn add @vivaxy/vlq or npm i @vivaxy/vlq

Usage

import { encode, decode } from '@vivaxy/vlq';
// encode
encode(0);
// decode
decode('A');

API

encode(input: number | number[]): string

decode(input: string): number[]

Benchmark

decode

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

encode

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

Related Projects

(Project created by create-n.)