Appearance
Class: Base91
Defined in: base91/src/base91.ts:23
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);
Extends
Methods
load()
static
load():Promise
<Base91
>
Defined in: base91/src/base91.ts:38
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.
unload()
static
unload():void
Defined in: base91/src/base91.ts:50
Unloades the compiled wasm instance.
Returns
void
version()
version():
string
Defined in: base91/src/base91.ts:57
Returns
string
The Base91 c++ version
encode()
encode(
data
):string
Defined in: base91/src/base91.ts:65
Parameters
data
Uint8Array
Data to encode.
Returns
string
string containing the Base 91 encoded data
decode()
decode(
base91Str
):Uint8Array
Defined in: base91/src/base91.ts:86
Parameters
base91Str
string
encoded string
Returns
Uint8Array
origonal data