Created
March 26, 2018 17:59
-
-
Save yarjor/ff63395f8346db7f2c5decdcca556bcb to your computer and use it in GitHub Desktop.
[BitString] Convert string to binary representation #crypto #decode
This file contains hidden or 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
| 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