Skip to content

Instantly share code, notes, and snippets.

@yarjor
Created March 26, 2018 17:59
Show Gist options
  • Select an option

  • Save yarjor/ff63395f8346db7f2c5decdcca556bcb to your computer and use it in GitHub Desktop.

Select an option

Save yarjor/ff63395f8346db7f2c5decdcca556bcb to your computer and use it in GitHub Desktop.
[BitString] Convert string to binary representation #crypto #decode
def bitstring(st):
bs = ''
for i in st:
bits = bin(ord(i))[2:]
bs += ('0' * (8 - len(bits))) + bits
return bs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment