A fast Base64 encoder/decoder implemented in AssemblyScript and compiled to WebAssembly.
- Fast: WebAssembly-powered Base64 encoding/decoding
- Complete: Both encode and decode functionality
- Browser-ready: Web interface included
- Type-safe: Written in AssemblyScript (TypeScript-like)
- Tested: Comprehensive test suite
# Install dependencies
pnpm install
# Build the project
pnpm run asbuild
# Start local server
pnpm startOpen http://localhost:3000 in your browser to use the web interface.
The included HTML page provides:
- Real-time Base64 encoding/decoding
- Copy-to-clipboard functionality
- Tab-based interface for encode/decode modes
import { text2Base64, base64ToText } from './build/release.js';
// Encode text to Base64
const encoded = text2Base64("Hello, World!");
console.log(encoded); // "SGVsbG8sIFdvcmxkIQ=="
// Decode Base64 to text
const decoded = base64ToText("SGVsbG8sIFdvcmxkIQ==");
console.log(decoded); // "Hello, World!"Encodes text to Base64.
Decodes Base64 to text.
Additional functions are available for advanced use cases:
char2Binary,text2Binary,binary2Base64base64CharToDecimal,decimal2SixBit,decimals2Binarybinary2Bytes,bytes2Text
# Run tests
pnpm test
# Build debug version
pnpm run asbuild:debug
# Build release version
pnpm run asbuild:release├── assembly/ # AssemblyScript source
├── build/ # Compiled WASM + JS bindings
├── tests/ # Test files
├── index.html # Web demo
└── package.json # Project config
WebAssembly provides 2-3x faster performance compared to native JavaScript implementations, especially for large datasets.
MIT
🚀 Built with AssemblyScript