Skip to content
This repository was archived by the owner on Aug 24, 2026. It is now read-only.

Repository files navigation

base64-rs

High-performance base64 encoder/decoder written in Rust🦅

PyPI version PyPI downloads PyPI requires python

CI Last Commit License

Features

  • 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
  • Drop-in replacement for CPython base64 (see: below)

Installation

Python Using pip:

pip install base64-rs

uv Using uv:

uv pip install base64-rs

Poetry Using poetry:

poetry add base64-rs

Examples

import 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='

References

Papers

GitHub repos

Contributors

lava-sh/base64-rs contributors

About

High-performance base64 encoder/decoder written in Rust

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages