Skip to content

Class: Base91

base91.Base91

Base 91 WASM library, similar to Base 64 but uses more characters resulting in smaller strings.

See Base91 for more details.

ts
import { Base91 } from "@hpcc-js/wasm/base91";

const base91 = await Base91.load();

const encoded_data = await base91.encode(data);
const decoded_data = await base91.decode(encoded_data);

Hierarchy

Methods

load

load(): Promise<Base91>

Compiles and instantiates the raw wasm.

INFO

In general WebAssembly compilation is disallowed on the main thread if the buffer size is larger than 4KB, hence forcing load to be asynchronous;

Returns

Promise<Base91>

A promise to an instance of the Base91 class.

Defined in

base91.ts:38


unload

unload(): void

Unloades the compiled wasm instance.

Returns

void

Defined in

base91.ts:50


version

version(): string

Returns

string

The Base91 c++ version

Defined in

base91.ts:57


encode

encode(data): string

Parameters

NameTypeDescription
dataUint8ArrayData to encode.

Returns

string

string containing the Base 91 encoded data

Defined in

base91.ts:65


decode

decode(base91Str): Uint8Array

Parameters

NameTypeDescription
base91Strstringencoded string

Returns

Uint8Array

origonal data

Defined in

base91.ts:86

Released under the Apache-2.0 License.