Skip to content

Instantly share code, notes, and snippets.

View orichcasperkevin's full-sized avatar

Casper Kevin Orich orichcasperkevin

View GitHub Profile
@perrygeo
perrygeo / base64_padding.md
Last active October 25, 2023 16:20
Avoiding TypeError: Incorrect padding with Python's base64 encoding

Avoiding padding errors with Python's base64 encoding

>>> import base64
>>> data = '{"u": "test"}'
>>> code = base64.b64encode(data)
>>> code
'eyJ1IjogInRlc3QifQ=='