Coder Social home page Coder Social logo

sdarre / hexc Goto Github PK

View Code? Open in Web Editor NEW
28.0 2.0 3.0 47 KB

Base converter for the terminal written in C.

License: GNU General Public License v3.0

C 97.37% Makefile 2.63%
c terminal hexadecimal-converter binary-converter decimal-converter octal-converter base-converter converter

hexc's Introduction

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

hexc's People

Contributors

chuahou avatar sdarre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hexc's Issues

feature request: chr conversion

Can you please add conversion to / from chr (character)? This would be very useful for me.

For example:

hexc -oc 042
042 -> "

hexc -cd !
! -> 33

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.