File: README.rst

package info (click to toggle)
python-unpaddedbase64 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 96 kB
  • sloc: python: 36; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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'