Base64 stream encode/decode library
Project description
b64-stream
b64-stream is a Python binding for the b64-stream. This is Base64 stream encode/decode library.
Installation
pip install b64-stream
Getting started
b64-stream implements classes:
Base64StreamDecode
Base64StreamEncode
Every class has:
- __init__(buffer_size: int = 2000) - buffer_size used by create buffer for update method for new encoded/decoded chunk.
- buffer_size - size of buffer
- total - total encoded/decoded bytes
- clear() - reset state to initial
- update(chunk) - processing chunk
- finalize() - end of processing
Usage examples
Decode data
from b64_stream import Base64StreamDecode
chunks = [b'MTIzNDU2', b'NzEyMzQ1Njc=']
result = []
decoder = Base64StreamDecode()
for chunk in chunks:
for r_chunk in decoder.update(chunk):
result.append(r_chunk)
decoder.finalize()
Encode data
chunks = [b'1234567', b'1234567']
encoder = Base64StreamEncode()
result = []
for chunk in chunks:
for r_chunk in encoder.update(chunk):
result.append(r_chunk)
result.append(encoder.finalize())
License
b64-stream is licensed under the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
b64-stream-1.0.0.tar.gz
(70.7 kB
view hashes)
Built Distributions
Close
Hashes for b64_stream-1.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5c349729ca7943f323fcc31f579c7f47ee5bbc6eef3eb3d3dc4f55ad0b82922 |
|
MD5 | c9ec62504fea1fdbfcaa867e330a3934 |
|
BLAKE2b-256 | 32f3080552ccdfe8bfd651e6f71a00e56669225017d787610cf76d8d0b65c9c3 |
Close
Hashes for b64_stream-1.0.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 267c0b5fac3e2a603944a22f2176a6051bd3807a448102f9776f5495d1b5e1bc |
|
MD5 | f18326304c3bb8d3eb0abce8f0ff4f1f |
|
BLAKE2b-256 | 65ad50679db361daf4ca1501a55c9c0052a65298eb8bbc939262b78dfb1c37b2 |
Close
Hashes for b64_stream-1.0.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa38528329bc77775c315ec310bfab9ac296d7bb30619e1f3706e13a3ac01671 |
|
MD5 | 1fd53816252b8b9b1a89fd662aab542e |
|
BLAKE2b-256 | d3251c357f1fd24c0e8a250afa45ecef2ddf2cd04bcfc8f45bdd00e28510c00c |