Skip to content

Instantly share code, notes, and snippets.

@glefait
Created May 4, 2018 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glefait/7731bb2b025a95b59e8660175958a3d5 to your computer and use it in GitHub Desktop.
Save glefait/7731bb2b025a95b59e8660175958a3d5 to your computer and use it in GitHub Desktop.
import base64
print(base64.b64encode(''.join(['{:08b}'.format(ord(c))for c in input()[::-1]]).encode('ascii')).decode('ascii'))
#decode
#s=base64.b64decode(input());print(''.join([chr(int(s[i:i+8],2))for i in range(0,len(s),8)][::-1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment