Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 544 Bytes

959.md

File metadata and controls

16 lines (12 loc) · 544 Bytes
  1. There are two kinds of whitespace in the text file (sed 's/\(.\)/\1\n/g' TheMessage.txt | sort | uniq -c), transform one into 0 and other into 1:

    with open("TheMessage.txt", 'r', encoding='utf-8') as file:
        content = file.read()
        space1, space2 = set(content)
        print(content.replace(space1, '0').replace(space2, '1'))
  2. Transform the binary into ASCII:

    echo "obase=16; ibase=2; <binary-string> | bc | xxd -r -p"