mirror of
https://github.com/matrix-org/python-unpaddedbase64.git
synced 2026-11-17 04:00:42 +00:00
Unpadded Base64
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github | ||
| tests | ||
| unpaddedbase64 | ||
| .flake8 | ||
| .gitignore | ||
| LICENSE | ||
| pyproject.toml | ||
| README.rst | ||
Unpadded Base64
===============
Encode and decode Base64 without "=" padding.
`RFC 4648`_ specifies that Base64 should be padded to a multiple of 4 bytes
using "=" characters. However many protocols choose to omit the "=" padding.
.. _`RFC 4648`: https://tools.ietf.org/html/rfc4648
Installing
----------
.. code:: bash
python3 -m pip install unpaddedbase64
Using
-----
.. code:: python
import unpaddedbase64
assert (unpaddedbase64.encode_base64(b'\x00')) == 'AA'
assert (unpaddedbase64.decode_base64('AA')) == b'\x00'