Skip to content
/ hexc Public

Base converter for the terminal written in C.

License

Notifications You must be signed in to change notification settings

sdarre/hexc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hexc

Terminal program for converting to and from any base from 2 to 36.

To build, run make. To install, build and run sudo make install. To uninstall, run sudo make uninstall.

Run hexc [operator] [strings] or hexc -i[input base] -o[output base] [strings] to produce a converted string or series of strings.

The operators are as follows:

Operator Description Operator Description
-bd Binary to decimal -hb Hexadecimal to binary
-bh Binary to hexadecimal -hd Hexadecimal to decimal
-bo Binary to octal -ho Hexadecimal to octal
-db Decimal to binary -ob Octal to binary
-dh Decimal to hexadecimal -od Octal to decimal
-do Decimal to octal -oh Octal to hexadecimal

hexc can be fed several strings, separated by whitespace. Bases can range from 2 to 36. The maximum value that can be entered for any given string is 18446744073709551615dec.

Examples

~$ hexc -bd 10101 111
10101 -> 21
111 -> 7
~$ hexc -i8 -o16 312
312 -> CA