Base64Encode class

Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64

Methods

encode(string)

Returns b64 encoded string from plaintext string.

urlEncode(string)

Returns URL Safe b64 encoded string from a plaintext string.

urlEncodeArr(Uint8Array)

Returns URL Safe b64 encoded string from an int8Array.

Method Details

encode(string)

Returns b64 encoded string from plaintext string.

function encode(input: string): string

Parameters

input

string

Returns

string

urlEncode(string)

Returns URL Safe b64 encoded string from a plaintext string.

function urlEncode(input: string): string

Parameters

input

string

Returns

string

urlEncodeArr(Uint8Array)

Returns URL Safe b64 encoded string from an int8Array.

function urlEncodeArr(inputArr: Uint8Array): string

Parameters

inputArr

Uint8Array

Returns

string