Base64 encoding and decoding for
ArrayBuffer
.
npm install @borderless/base64 --save
import { encode, encodeUrl, decode } from "@borderless/base64";
expect(encode(new TextEncoder().encode("hello"))).toEqual("aGVsbG8=");
expect(encode(new TextEncoder().encode("你好"))).toEqual("5L2g5aW9");
This project is written using TypeScript and publishes the definitions directly to NPM.
MIT
Originally based on base64-arraybuffer, enhanced using TypeScript, ESM and support for Base64URL.