Terminal based bitwise calculator in curses
bitwise can be used both Interactively and in command line mode.
In command line mode, passing a number in any base (Decimal, Hexadecimal & Octal) will output the number in all bases including binary representation.
bitwise detects the base by the preface of the input (0x/0X for hexadecimal, leading 0 for octal, and the rest is decimal).
$ ./bitwise 0x12312311
Decimal: 305210129
Hexdecimal: 0x12312311
Octal: 02214221421
Size: 291.07MB
Binary:
0 0 0 1 0 0 1 0 | 0 0 1 1 0 0 0 1 | 0 0 1 0 0 0 1 1 | 0 0 0 1 0 0 0 1
31 - 24 23 - 16 15 - 8 7 - 0
bitwise starts in interactive mode if no command line parameters are passed or if the -i | --interactive flag is passed. In this mode, you can input a number and manipulate it and see the other bases change dynamically. It also allows changing individual bits in the binary.
To move around use the arrow keys, or use vi key bindings : h j k l .
You can toggle a bit bit using the space key.
Reducing or extending the bit width interactively is also very easy, just use:
! for 8bit, @ for 16Bit, $ for 32Bit and * for 64Bit.
When changing the bit width, the number is masked with the new width, so you might lost precision, use with care.
Leave the program by pressing q .
If your distribution supports Snap just type:
sudo snap install bitwise
Your can use the AUR repository: https://aur.archlinux.org/packages/bitwise/
Make sure you have ncurses package installed
- Download latest release.
- unpack release
- ./configure
- make
- sudo make install