Ain’t coder

Ain’t coder (just ain’t coder instead of encoder) – A very simple encoder that converts each character from the input data to a hexadecimal number.

Installation

Clone repository:

git clone https://github.com/solarless/aint-coder.git
cd aint-coder/

Create a virtual environment: python -m venv env. On Linux you should use python3 instead of python.

Activate the virtual environment:

env\Scripts\activate.bat   <- on Windows
source env/bin/activate    <- on Linux

And install all dependencies: pip install -r requirements.txt

Usage

Flag Description
-e --encode Converts the input data to a hexadecimal number.
The default action.
-d --decode Converts the input data to a normal string.
-k <key> --key <key> The number that serves as a multiplier.
The default key is defined in User configurations

Examples

python src/main.py
Hello, world!              <- Here's the input

0x9c0:0x280:0x440:0x440:0x500:0x13c0:0x0:0x700:0x500:0x5c0:0x440:0x240:0x1100   <- Here's the output


python src/main.py --decode
0x9c0:0x280:0x440:0x440:0x500:0x13c0:0x0:0x700:0x500:0x5c0:0x440:0x240:0x1100

Hello, world!


python src/main.py --key 32
Hello, world!

0x4e0:0x140:0x220:0x220:0x280:0x9e0:0x0:0x380:0x280:0x2e0:0x220:0x120:0x880


python src/main.py --decode --key 32
0x4e0:0x140:0x220:0x220:0x280:0x9e0:0x0:0x380:0x280:0x2e0:0x220:0x120:0x880

Hello, world!

User configurations

The user configurations is defined in top of the src/main.py:

KEY = 64

FORMAT_SPEC = '#x'

SEPARATOR = ':'

KEY – The default key.

FORMAT_SPEC – The Mini-Language format specification. Supports only the hexadecimal format:

  • x – lower case with no prefix.
  • X – upper case with no prefix.
  • #x – lower case with 0x prefix.
  • #X – upper case with 0x prefix.

SEPARATOR – The character that serves as an encoded words separator. You can use any punctuation character.

GitHub

https://github.com/solarless/aint-coder