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 December 9, 2025 17:50
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=='