b2x
is a cli tool and library for converting between data formats and types.
Common use-cases involve converting binary to hexadecimal or hexadecimal to utf-8.
b2x <from> <to> <input>
b2x bin <to> <input>
The conversion target to convert the binary bit string to
- dec
- f32
- f64
- hex
- ascii
- utf-8
The binary bit string to convert
For example, 1010 1001
or just 10101001
b2x bin dec <input>
Interpret input
binary string as signed values.
Unsigned by default
Interpret input
binary string bits as big endinan
Little endian by default
Set a fixed size of the input binary string bit groupings. The default behaviour is to use space as the value delimiter
- optional
- default: uses spaces as value delimiter
- values: 2-64
b2x bin dec 1011 1010
=> 11 10
b2x bin f32 <input>
b2x bin f64 <input>
Interpret input
binary string bits as big endinan
Little endian by default
b2x bin f32 1011 1010
=> 11 10
b2x bin f64 1011 1010
=> 11 10
b2x bin hex <input>
b2x bin hex 11010 11011
=> 0x1A 0x1B
b2x bin ascii <input>
b2x bin ascii 01001111 01001110
=> ON
b2x bin utf-8 <input>
b2x bin utf-8 11000010 10110101
=> µ