I have a string that I\'m encoding into base64 to conserve space. Is it a big deal if I remove the equal sign at the end? Would this significantly decrease entropy? What can I d
Other than in the case @Martin Ellis points out, messing with the padding characters can lead to getting a
TypeError: Incorrect padding
and And producing some garbage while you're at it.
As stated by @MattH, base64 will do the opposite of conserving space.
Instead to conserve space, you should apply compression algorithms such as zlib.
For example, zlib
import zlib
s = '''large string....'''
compressed = zlib.compress(s)
compression_ratio = len(s)*1.0/len(compressed)
# And later...
out = zlib.decompress(compressed)
# The above function is also good for relieving stress.