Appearance
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
↳
Base91
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
unload
▸ unload(): void
Unloades the compiled wasm instance.
Returns
void
Defined in
version
▸ version(): string
Returns
string
The Base91 c++ version
Defined in
encode
▸ encode(data
): string
Parameters
Name | Type | Description |
---|---|---|
data | Uint8Array | Data to encode. |
Returns
string
string containing the Base 91 encoded data
Defined in
decode
▸ decode(base91Str
): Uint8Array
Parameters
Name | Type | Description |
---|---|---|
base91Str | string | encoded string |
Returns
Uint8Array
origonal data