Skip to content

Instantly share code, notes, and snippets.

@arigesher
Forked from anonymous/-
Created May 9, 2014 05:53
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 arigesher/622eb3899ec0b26bff40 to your computer and use it in GitHub Desktop.
Save arigesher/622eb3899ec0b26bff40 to your computer and use it in GitHub Desktop.
decode binary string - python
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