Skip to content

Base64

Prefer the UTF-8 or Base64URL APIs in new code:

ts
import { decodeBase64, encodeBase64, encodeBase64Url } from "@fast-china/utils";

const encoded = encodeBase64('{"name":"Fast utilities"}');
const decoded = decodeBase64(encoded);
decoded;
decoded.parseJson<{ name: string }>();
encodeBase64Url("path/value");

encodeSecureBase64 and decodeSecureBase64 apply reversible text obfuscation using a custom dictionary and prefix; they are not encryption. Use the UTF-8 Base64 or Base64URL methods above for general text transport. Neither encoding nor obfuscation protects passwords, tokens, or other secrets.