Skip to content

Instantly share code, notes, and snippets.

@rgegriff
Created July 31, 2016 22:54
Show Gist options
  • Save rgegriff/8313882f0e4a45219f27c54e6696267c to your computer and use it in GitHub Desktop.
Save rgegriff/8313882f0e4a45219f27c54e6696267c to your computer and use it in GitHub Desktop.
def mesij_decode(s):
s = s.replace("\r\n","")
normal = '~'+string.uppercase+string.lowercase+string.digits+"+/"
rev = "".join(reversed(normal))
rev = "="+rev[:-1]
transtab = string.maketrans(normal, rev)
ts = string.translate(s, transtab)
print normal+"\n"+rev+"\n"+s+"\n"+ts
return base64.b64decode(ts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment