I\'m working on a python web service. It calls another web service to change the picture of a profile.
It connects to another web service. This web service can only
I'm using this:
def size(b64string):
return (len(b64string) * 3) / 4 - b64string.count('=', -2)
We remove the length of the padding, which is either no, one or two characters =, as explained here.
Probably not optimal. I don't how efficient str.count(char) is. On the other hand, it is only performed on a string of length 2.