by Acorn · 15y ago · 0 comments
http://stackoverflow.com/questions/5940416/compress-a-series...
>>> bin_string = '000111000010101010101000101001110'
>>> encode(bin_string)
'hcQOPgd'
>>> decode(encode(bin_string))
'000111000010101010101000101001110'Base64 encoding also seems to result in quite long ascii strings compared to what I threw together.
Or is there a way to use Base64 which would give results of a comparable length?
As wikipedia says, padding can be added or removed as a matter of taste: From a theoretical point of view the padding character is not needed, since the number of missing bytes can be calculated from the number of base64 digits.