Created
April 15, 2015 11:57
-
-
Save anantshri/bcb9caecc7ec76c3b42d to your computer and use it in GitHub Desktop.
remove all = from a probable base64 string but preserve the last 1 or 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str1="ssdggagad=gadg=adg=dasgadsg=as=gads=gas=as=asgas214=12rf=sdvgewt23g=vew=g4==" | |
x=str1[len(str1) - 2:] | |
if x == "==": | |
print str1.replace("=","") + x | |
else: | |
print str1.replace("=","") + "=" | |
str2="ssdggagad=gadg=adg=dasgadsg=as=gads=gas=as=asgas214=12rf=sdvgewt23g=vew=g4=" | |
x=str2[len(str2) - 2:] | |
if x == "==": | |
print str2.replace("=","") + x | |
else: | |
print str2.replace("=","") + "=" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment