Probably many people have written something like this, for converting those joke images purporting to contain L3E7 h4xx0R c0deZ
.
Data examples:
ascii-bits.txt
: taken from a random pic of a mini typewriter with a1
and0
keyboard.message.txt
: taken from a music video ad with an AI-type character
Script:
- Takes a text file with typed
1
and0
characters to represent bits. - Strips all whitespace
- Converts them to 8-bit bytes, and prints the results.
- Two types of padding are done in case the number of bits is not a multiple of 8.
- Optionally specify an encoding to use for string printing.
A naive, dirty implementation whacked together in a few minutes.
python3 convert-bitstring.py ascii-bits.txt [ENCODING]
Output for ascii-bits.txt:
Output for message.txt: