Base64 / binary data / UTF-8 strings utilities

It ensures that UTF-8 characters are used when encoding to Base64.

Based on code of: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding

import { encodeBase64 } from "apprt-core/base64";

const base64str = encodeBase64("hello world");
// base64str === "aGVsbG8gd29ybGQ="
import { decodeBase64 } from "apprt-core/base64";

const str = decodeBase64("aGVsbG8gd29ybGQ=");
// str === "hello world"

Functions

base64DecodeToUtf8Arr
base64EncodeUtf8Arr
decodeBase64
encodeBase64
strToUtf8Arr
utf8ArrToStr