Skip to main content

Cython bindings for Turbo Base64

Project description

Turbo Base64

PyPI AppVeyor

🚀 Lightning fast base64 encoding for Python

✨ Features

  • 20-30x faster than the standard library
  • Benchmarks faster than any other C base64 library
  • Fastest implementation of AVX, AVX2, and AVX512 base64 encoding
  • No other dependencies

⚡ How fast is it?

Graph generated from benchmark.py:


💻 Usage

>>> import turbob64

This will automatically detect the fastest algorithm your CPU is capable of and use it.

Encoding

>>> turbob64.b64encode(b'Hello World!')
b'SGVsbG8gV29ybGQh'

Decoding

>>> turbob64.b64decode(b'SGVsbG8gV29ybGQh')
b'Hello World!'

Other Functions

Directly call CPU-specific algorithms

Memory efficient (small lookup tables) scalar but slower version

turbob64.b64senc(b'Hello World!')
turbob64.b64sdec(b'SGVsbG8gV29ybGQh')

Fast scalar

turbob64.b64xenc(b'Hello World!')
turbo64.b64xdec(b'SGVsbG8gV29ybGQh')

ssse3 SIMD

turbob64.b64v128enc(b'Hello World!')
turbob64.b64v128dec(b'SGVsbG8gV29ybGQh')

avx SIMD

turbob64.b64v128aenc(b'Hello World!')
turbob64.b64v128adec(b'SGVsbG8gV29ybGQh')

avx2 SIMD

turbob64.b64v256enc(b'Hello World!')
turbob64.b64v256dec(b'SGVsbG8gV29ybGQh')

avx2 SIMD (optimized for short strings)

turbob64.b64v256enc_short(b'Hello World!')
turbob64.b64v256dec_short(b'SGVsbG8gV29ybGQh')

avx512_vbmi SIMD

turbob64.b64v512enc(b'Hello World!')
turbob64.b64v512dec(b'SGVsbG8gV29ybGQh')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

turbob64-1.1.1.tar.gz (46.3 kB view hashes)

Uploaded Source

Built Distributions

turbob64-1.1.1-cp311-cp311-win_amd64.whl (66.3 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

turbob64-1.1.1-cp310-cp310-win_amd64.whl (65.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

turbob64-1.1.1-cp39-cp39-win_amd64.whl (65.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

turbob64-1.1.1-cp38-cp38-win_amd64.whl (65.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

turbob64-1.1.1-cp37-cp37-win_amd64.whl (65.8 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page