Bitwise is multi base interactive calculator supporting dynamic base convertion and bit manipulation. It's a handy tool for low level hackers, kernel developers and device drivers developers.
Some of the features include:
- Interactive ncurses interface
- Command line calculator supporting all bitwise operations.
- Individual bit manipulator.
- Bitwise operations such as NOT, OR, AND, XOR, and shifts.
bitwise can be used both Interactively and in command line mode.
In command line mode, bitwise will calculate the given expression and will output the result in all bases including binary representation.
bitwise detects the base by the preface of the input (0x/0X for hexadecimal, leading 0 for octal, b for binary, 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 "0x30 * 0x20 30 / 2"
Decimal: 1551
Hexdecimal: 0x60F
Octal: 03017
Size: 1.51KB
Binary:
0 0 0 0 0 1 1 0 | 0 0 0 0 1 1 1 1
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 . Leave the program by pressing q .
You can toggle a bit bit using the space key. You can jump a byte forward using w and backwards one byte using b .
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.
Press ~ to perform the NOT operator.
sudo add-apt-repository ppa:ramon-fried/bitwise
sudo apt-get update
sudo apt-get install bitwise
If your distribution supports Snap just type:
sudo snap install bitwise
Your can use the AUR repository: https://aur.archlinux.org/packages/bitwise/
No, wait. really ???
Make sure you have ncurses package installed
- Download the latest release
tar xfz RELEASE-FILE.TAR.GZ
cd RELEASE-DIR
./configure
make
sudo make install