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

Example: Encode string to Base64

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

const base64str = encodeBase64("hello world");
// base64str === "aGVsbG8gd29ybGQ="

Example: Decode Base64 string

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

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

Index

Functions

Generated using TypeDoc