Start a personal dev blog on your domain for free with Hashnode and grow your readership.
Get Started

Encoding/Decoding with Python

These last few years, I had fun with some challenges related to weird encodings (e.g. Morse, and so forth). So I decided to make something using Python to handle these particular ones. First, I discovered how the native codecs library worked in order to understand how to add my own codecs upon.

It then ended into a new package called CODecs EXTension enhancing the native one, available here. codext handles a myriad of new codecs and provides a CLI tool that is especially useful for chaining encodings.

Demonstration :

$ echo -en "Test string" | codext reverse
gnirts tseT

$ echo -en "Test string" | codext reverse swapcase
GNIRTS TSEt

$ echo -en "Test string" | codext reverse swapcase base58-bitcoin
JgZRLASSXJV4PaB

$ echo -en "Test string" | codext reverse swapcase base58-bitcoin barbie-2
<dFEURTT2<X5KtC

$ echo -en "Test string" | codext reverse swapcase base58-bitcoin barbie-2 html-entity
&lt;dFEURTT2&lt;X5KtC

$ echo -en "Test string" | codext reverse swapcase base58-bitcoin barbie-2 html-entity morse
.-... .-.. - -.-.-. -.. ..-. . ..- .-. - - ..--- .-... .-.. - -.-.-. -..- ..... -.- - -.-.

Documentation is also provided here for making new ones. A word to the wise... :-)

Start a personal dev blog on your domain for free and grow your readership.

3.4K+ developers have started their personal blogs on Hashnode in the last one month.

Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more

No Comments Yet