1.10 Rax

The 'rax' utility comes with the radare framework and aims to be a minimalistic expression evaluator for the shell useful for making base conversions easily between floating point values, hexadecimal representations, hexpair strings to ascii, octal to integer. It supports endianness and can be used as a shell if no arguments given.

$ rax -h
Usage: rax [-] | [-s] [-e] [int|0x|Fx|.f|.o] [...]
 int   ->  hex           ;  rax 10
 hex   ->  int           ;  rax 0xa
 -int  ->  hex           ;  rax -77
 -hex  ->  int           ;  rax 0xffffffb3
 float ->  hex           ;  rax 3.33f
 hex   ->  float         ;  rax Fx40551ed8
 oct   ->  hex           ;  rax 035
 hex   ->  oct           ;  rax Ox12 (O is a letter)
 bin   ->  hex           ;  rax 1100011b
 hex   ->  bin           ;  rax Bx63
 -e    swap endianness   ;  rax -e 0x33
 -s    swap hex to bin   ;  rax -s 43 4a 50
 -     read data from stdin until eof

Some examples:

$ rax 0x345
837
$ rax 837
0x345
$ rax 44.44f
Fx8fc23142
$ rax 0xfffffffd
-3
$ rax -3
0xfffffffd
$ rax -s "41 42 43 44"
ABCD