Skip to content

Instantly share code, notes, and snippets.

@shpigunov
Created October 10, 2018 18:40
Show Gist options
  • Save shpigunov/d59a38e9d6a273980464fb509f00fd42 to your computer and use it in GitHub Desktop.
Save shpigunov/d59a38e9d6a273980464fb509f00fd42 to your computer and use it in GitHub Desktop.
RUINER bin read and write
def write_bin(s):
return ' '.join(format(ord(x), 'b') for x in s)
def read_bin(s):
return ''.join([chr(int(c, 2)) for c in s.split()])
read_bin("01010100 01110101 01100101 01110011 01100100 01100001 01111001")
write_bin("Tuesday")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment