Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.
/ vlq Public archive

🔣Decode and encode Base64 VLQ.

License

Notifications You must be signed in to change notification settings

vivaxy/vlq

Repository files navigation

@vivaxy/vlq

Build Status NPM Version NPM Downloads MIT License Standard Version Codecov DOI

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.)