Package: pybase64
Fast Base64 implementationThis project is a wrapper onlibbase64.It aims to provide a fast base64 implementation for base64 encoding/decoding.Installationpip install pybase64Usagepybase64uses the same API as Python base64 “modern interface” (introduced in Python 2.4) for an easy integration.To get the fastest decoding, it is recommended to use thepybase64.b64decodeandvalidate=Truewhen possible.importpybase64print(pybase64.b64encode(b'>>>foo???',altchars='_:'))# b'Pj4_Zm9vPz8:'print(pybase64.b64decode(b'Pj4_Zm9vPz8:',altchars='_:',validate=True))# b'>>>foo???'# Standard encoding helpersprint(pybase64.standard_b64encode(b'>>>foo???'))# b'Pj4+Zm9vPz8/'print(pybase64.standard_b64decode(b'Pj4+Zm9vPz8/'))# b'>>>foo???'# URL safe encoding helpersprint(pybase64.urlsafe_b64encode(b'>>>foo???'))# b'Pj4-Zm9vPz8_'print(pybase64.urlsafe_b64decode(b'Pj4-Zm9vPz8_'))# b'>>>foo???'A command-line tool is also provided. It has encode, decode and benchmark subcommands.usage: pybase64 [-h] [-V] {benchmark,encode,decode} ...

pybase64 command-line tool.

positional arguments:
  {benchmark,encode,decode}
                        tool help
    benchmark           -h for usage
    encode              -h for usage
    decode              -h for usage

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exitFull documentation onRead the Docs.BenchmarkRunning Python 3.7.2, Apple LLVM version 10.0.0 (clang-1000.11.45.5), Mac OS X 10.14.2 on an Intel Core i7-4870HQ @ 2.50GHzpybase64 0.5.0 (C extension active - AVX2)
bench: altchars=None, validate=False
pybase64._pybase64.encodebytes:   1734.776 MB/s (13,271,472 bytes -> 17,928,129 bytes)
pybase64._pybase64.b64encode:     4039.539 MB/s (13,271,472 bytes -> 17,695,296 bytes)
pybase64._pybase64.b64decode:     1854.423 MB/s (17,695,296 bytes -> 13,271,472 bytes)
base64.encodebytes:                 78.352 MB/s (13,271,472 bytes -> 17,928,129 bytes)
base64.b64encode:                  539.840 MB/s (13,271,472 bytes -> 17,695,296 bytes)
base64.b64decode:                  287.826 MB/s (17,695,296 bytes -> 13,271,472 bytes)
bench: altchars=None, validate=True
pybase64._pybase64.b64encode:     4156.607 MB/s (13,271,472 bytes -> 17,695,296 bytes)
pybase64._pybase64.b64decode:     4107.997 MB/s (17,695,296 bytes -> 13,271,472 bytes)
base64.b64encode:                  559.342 MB/s (13,271,472 bytes -> 17,695,296 bytes)
base64.b64decode:                  143.674 MB/s (17,695,296 bytes -> 13,271,472 bytes)
bench: altchars=b'-_', validate=False
pybase64._pybase64.b64encode:     2786.776 MB/s (13,271,472 bytes -> 17,695,296 bytes)
pybase64._pybase64.b64decode:     1124.136 MB/s (17,695,296 bytes -> 13,271,472 bytes)
base64.b64encode:                  322.427 MB/s (13,271,472 bytes -> 17,695,296 bytes)
base64.b64decode:                  205.195 MB/s (17,695,296 bytes -> 13,271,472 bytes)
bench: altchars=b'-_', validate=True
pybase64._pybase64.b64encode:     2806.271 MB/s (13,271,472 bytes -> 17,695,296 bytes)
pybase64._pybase64.b64decode:     2740.456 MB/s (17,695,296 bytes -> 13,271,472 bytes)
base64.b64encode:                  314.709 MB/s (13,271,472 bytes -> 17,695,296 bytes)
base64.b64decode:                  121.803 MB/s (17,695,296 bytes -> 13,271,472 bytes)Changelog1.3.2Update base64 libraryPyPy: fix wrong outcome with non C-contiguous buffer1.3.1Add missing py.typed marker1.3.0Update base64 libraryAdd AVX512-VBMI implementationRework extension build to remove adherence on distutilsPublish python 3.12 wheelsDocumentation now uses furo theme1.2.3Update base64 libraryPublish python 3.11 wheels1.2.2Update base64 libraryFix C extension build on musl distrosPublish musllinux wheels1.2.1Publish PyPy 3.8 (pypy38_pp73) wheels1.2.0Release the GILPublish CPython 3.10 wheelsDrop python 3.5 support1.1.4Add macOS arm64 wheel1.1.3GitHub Actions: fix build on tag1.1.2Add PyPy wheelsAdd aarch64, ppc64le & s390x manylinux wheels1.1.1Move CI from TravisCI/AppVeyor to GitHub ActionsFix publication of Linux/macOS wheels1.1.0Add b64encode_as_string, same as b64encode but returns a str object instead of a bytes objectAdd b64decode_as_bytearray, same as b64decode but returns a bytarray object instead of a bytes objectSpeed-Up decoding from UCS1 strings1.0.2Update base64 libraryPublish python 3.9 wheels1.0.1Publish python 3.8 wheels1.0.0Drop python 3.4 supportDrop python 2.7 support0.5.0Publish python 3.7 wheelsDrop python 3.3 support0.4.0Speed-up decoding when validate==False0.3.1Fix deployment issues0.3.0Add encodebytes function0.2.1Fixed invalid results on Windows0.2.0Added documentationAdded subcommands to the main script:helpversionencodedecodebenchmark0.1.2Updated base64 native library0.1.1Fixed deployment issues0.1.0First public release