Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created June 24, 2011 02:16
Show Gist options
  • Save lxneng/1044096 to your computer and use it in GitHub Desktop.
Save lxneng/1044096 to your computer and use it in GitHub Desktop.
>>> string = base64.urlsafe_b64encode('hello').strip('=')
>>> base64.urlsafe_b64decode(string + '=' * (-len(string) % 4))
'hello'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment