Base64
Base64 adapter for WebAssembly and JS implementations
npm i @hazae41/base64
Node Package 📦
Features
Current features
- 100% TypeScript and ESM
- No external dependencies
Getting started
Alocer (WebAssembly)
import { Base64 } from "@hazae41/base64"
import { Alocer } from "@hazae41/alocer"
await Alocer.initBundledOnce()
const base64 = Base64.fromAlocer(Alocer)
Base64.set(base64)
Scure (JavaScript)
import { Base64 } from "@hazae41/base64"
import * as scure from "@scure/base"
const base64 = Base64.fromScure(scure.base64)
Base64.set(base64)
Usage
Direct
const encoded: string = base64.tryEncode(new Uint8Array([1,2,3,4,5])).unwrap()
const decoded: Uint8Array = base64.tryDecode(encoded).unwrap().copy()