-
-
Save arigesher/622eb3899ec0b26bff40 to your computer and use it in GitHub Desktop.
decode binary string - python
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
for i in range(0,len(data),8): | |
bound = i+8 | |
if i + 8 > len(data): | |
bound = len(data) - 1 | |
byte = data[i+1:bound] | |
val = int(byte,2) | |
out = '%s%c'%(out,val) | |
print out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment