function EposImageHelpers.rawUtoa
rawUtoa(
u8: Uint8Array,
alphabet?: string,
padding?: string,
): string

A pure JS Uint8Array Base64 encoder. You should probably use utoa instead.

Based on Stackoverflow: How to convert uint8 Array to base64 Encoded String?

Dependencies:

  • number
  • Number.prototype.length
  • Number.prototype.toString
  • string
  • String.prototype.startsWith
  • String.prototype.match
  • String.prototype.map
  • RegExp
  • undefined
  • Error (optional)
  • JSON.stringify (optional, for error message)

Parameters

u8: Uint8Array
optional
alphabet: string = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/

The base64 alphabet to use

optional
padding: string = =

The character to use for padding

Return Type

string

Usage

import { EposImageHelpers } from ".";
const { rawUtoa } = EposImageHelpers;