Skip to content

Latest commit

 

History

History
84 lines (66 loc) · 1.91 KB

README.md

File metadata and controls

84 lines (66 loc) · 1.91 KB

Coin

A lightweight program for UNIX systems for converting single or multiple hex/decimal/binary values at once. Includes a few optional flags for desired output.

Also inludes a file hexdump, straight to your terminal.

Prerequisites

You need makefile to compile the program

sudo apt install make

and C compiler

sudo apt install gcc

After installing these packets, type command make in the directory where this program is.

After compiling the program

Write the following command to see the list of available commands

./coin --h

Examples

Let's convert some hexadecimal values into decimal and binary values

vtothek@ubuntu ~ $ coin -hd 9F
159 

You can also chain values to get multiple conversions

vtothek@ubuntu ~ $ coin -hd 9F 800A FFA
159 32778 4090

Binary conversion

vtothek@ubuntu ~ $ coin -hb 9F 800A FFA
10011111 1000000000001010 111111111010 

Invalid input example

vtothek@ubuntu ~ $ coin -hb 9F 800A FFA 9G
10011111 1000000000001010 111111111010 Invalid input 

Optional flags

You can also print the input values, use custom delimiter and print values vertically

Original input values with --ov flag

vtothek@ubuntu ~ $ coin -hd 9F 800A FFA 9G --ov
9F=159 800A=32778 FFA=4090 9G=Invalid input 

Custom input/output delimiter with --cd flag

vtothek@ubuntu ~ $ coin -hd 9F 800A FFA 9G --ov --cd::
9F::159 800A::32778 FFA::4090 9G::Invalid input

Vertical output with --v flag

vtothek@ubuntu ~ $ coin -hd 9F 800A FFA 9G --ov --cd:: --v
9F::159 
800A::32778 
FFA::4090 
9G::Invalid input

File hexdump

You can print colored file hexdump into console with -f flag.

Coin hexdump

You can also limit the amout of outputted bytes with --l flag.

Coin hexdump bytes limited

Youtube demo

https://www.youtube.com/watch?v=-IPx8CzpF5A&