-
High-performance base64 encoder/decoder
-
Runtime SIMD dispatch with support for:
- AVX-512F, AVX-512VL, AVX-512VBMI, AVX2, AVX
- SSE4.2, SSE4.1, SSSE3
- NEON64, NEON32
Using pip:
pip install base64-rs
Using uv:
uv pip install base64-rs
Using poetry:
poetry add base64-rsimport base64_rs
print(base64_rs.b64encode(b"lava-sh")) # b'bGF2YS1zaA=='Compatibility with CPython base64
base64-rs is a drop-in replacement for CPython's base64
lin on Python 3.15+. Its compatible functions use the same call signatures,
parameters, defaults, and return values, so existing imports can be replaced
without changing call sites.
import base64_rs as base64
print(base64.b64encode(b"lava-sh")) # b'bGF2YS1zaA=='
print(base64.standard_b64encode(b"\xfb\xff")) # b'+/8='
print(base64.urlsafe_b64encode(b"\xfb\xff")) # b'-_8='