Last Friday i was at Metro Olografix’s “Weekend of magic II” and we were talking; during the configuration of a wireless card of a guest there’s the need to convert a string from ascii to its hexadecimal value , obviously it’s possible to do that with mind, or with pencil and paper, or with the bash printf or whatsoever but, hey, when magic is required, magic is provided!
So I’ve made this little piece of code, and of course i’ve decided to share it with the whole world (oh, what a good boy i am).
I’ve chose to use CMake also this time, so the way is, like you can imagine:
isazi@data:~$ tar xzvf ascii2hex-0.1.tar.gz ascii2hex/main.c isazi@data:~$ cd ascii2hex isazi@data:~/ascii2hex$ cmake .
After some output you obtain a “ready to use” Makefile, just type make and there’ll be a nice executable named ascii2hex all for you; as you can see the tool it’s really easy to use:
isazi@data:~/ascii2hex$ ./ascii2hex -a einsturzende! 65696E737475727A656E646521 isazi@data:~/ascii2hex$ ./ascii2hex -h 65696E737475727A656E646521 einsturzende!
Hope you enjoy that.