All Projects → mellowcandle → Bitwise

mellowcandle / Bitwise

Licence: gpl-3.0
Terminal based bit manipulator in ncurses

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Bitwise

Mitype
Typing speed test in terminal
Stars: ✭ 241 (-36.58%)
Mutual labels:  terminal-app, curses
Rubiks cube
rubik's cube that runs in your terminal!
Stars: ✭ 73 (-80.79%)
Mutual labels:  terminal-app, curses
blessed-xterm
XTerm Widget for Blessed Curses Environment
Stars: ✭ 37 (-90.26%)
Mutual labels:  curses
Ticker
Terminal stock ticker with live updates and position tracking
Stars: ✭ 3,986 (+948.95%)
Mutual labels:  terminal-app
nlarn
A rewrite of Noah Morgan's classic roguelike game Larn (1986).
Stars: ✭ 32 (-91.58%)
Mutual labels:  curses
jira-cli
🔥 [WIP] Feature-rich interactive Jira command line.
Stars: ✭ 809 (+112.89%)
Mutual labels:  terminal-app
Github cli
GitHub on your command line. Use your terminal, not the browser.
Stars: ✭ 263 (-30.79%)
Mutual labels:  terminal-app
curse
Use this blacklist on your softwares and apps
Stars: ✭ 24 (-93.68%)
Mutual labels:  curses
Pick
create curses based interactive selection list in the terminal
Stars: ✭ 370 (-2.63%)
Mutual labels:  curses
CoTerminalApps
Retro ASCII Puzzles plus SpaceInvaders, Pacman & Frogger arcade games that run WITH SOUND in a terminal on any platform !!
Stars: ✭ 21 (-94.47%)
Mutual labels:  terminal-app
Termox
C++17 Terminal User Interface(TUI) Library.
Stars: ✭ 306 (-19.47%)
Mutual labels:  curses
cpub
commandline epub reader using python/curses
Stars: ✭ 29 (-92.37%)
Mutual labels:  curses
exch
a command-line tool to see currency exchange rates
Stars: ✭ 20 (-94.74%)
Mutual labels:  terminal-app
Pydoro
🍅 pydoro - Terminal Pomodoro Timer
Stars: ✭ 277 (-27.11%)
Mutual labels:  terminal-app
git-cheats-cli
Git Cheats CLI - A Companion For Gitcheats
Stars: ✭ 13 (-96.58%)
Mutual labels:  terminal-app
Rebound
Command-line tool that instantly fetches Stack Overflow results when an exception is thrown
Stars: ✭ 3,763 (+890.26%)
Mutual labels:  terminal-app
ffxiv-better-autokey
Windows terminal tool for automating keystrokes to processes.
Stars: ✭ 15 (-96.05%)
Mutual labels:  terminal-app
Typon
A multi-featured typing practice tool that runs on a terminal emulator which can turn any text file into a typing game.
Stars: ✭ 53 (-86.05%)
Mutual labels:  terminal-app
Termkit
Terminal Kit - Console UI toolkit for Swift applications
Stars: ✭ 256 (-32.63%)
Mutual labels:  curses
Castero
TUI podcast client for the terminal
Stars: ✭ 375 (-1.32%)
Mutual labels:  curses

Bitwise

Terminal based bitwise calculator in curses

Build Statuscodecov Snap Status Coverity Scan Build Status Packaging status

Bitwise is multi base interactive calculator supporting dynamic base conversion 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.

Demo

Usage

bitwise can be used both Interactively and in command line mode.

Command line calculator 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).

Examples:

Simple base conversion

conversion

C style syntax Calculator

calculator

Interactive mode

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. You can show the help screen by pressing F1 .

Navigation in interactive mode

To move around use the arrow keys, or use vi key bindings : h j k l . Leave the program by pressing q .

Binary specific movement

You can toggle a bit bit using the space key. You can jump a byte forward using w and backwards one byte using b .

Bitwise operation in interactive mode

Setting the bit width:

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.

NOT:

Press ~ to perform the NOT operator.

Shifts

Press < and > to perform the left or right shift.

expression calculator in interactive mode

You can enter expression calculator mode by typing : (Just like in vim).

To exit the mode, just press ESC .

In this mode, you can type any expression you like to be evaluated. The result will be printed in the history window and also printed in the binary and various bases on top.

operators and functions
  • All C operators are supported, additionally, you can use the "$" symbol to refer to the last result.
  • Refer to a specific bit by using the function BIT(x).
commands
  • help - Show the help screen.
  • clear - Clear the history window.
  • width [8 | 16 | 32 | 64] - Set the required width mask
  • output [decimal | hex | octal | binary | all] - Set the default output for results.
  • q - Exit

Integration with other software

Vim

Installation

Linux

Ubuntu

From 20.04 you can just type

sudo apt-get install bitwise

For earlier versions:

sudo add-apt-repository ppa:ramon-fried/bitwise
sudo apt-get update
sudo apt-get install bitwise

Snap

If your distribution supports Snap just type: sudo snap install bitwise

OpenSuse

zypper install bitwise

Arch

You can use the AUR repository: https://aur.archlinux.org/packages/bitwise/

Void

bitwise is in the default repository, so just type: sudo xbps-install -S bitwise

Buildroot / Yocto

Bitwise is available both in Buildroot and in Yocto, please refer to the documentation on how to add those to your target image.

macOS

MacPorts

sudo port install bitwise

Homebrew

brew install bitwise

Windows

NCurses doesn't support windows. You can use the windows subsystem for Linux as a workaround.

Building from source

Prerequisites

  • libreadline
  • libncurses (with forms)
  • libcunit (only needed for testing)

On Ubuntu/Debian system you can just paste:

sudo apt-get install build-essential
sudo apt-get install libncurses5-dev
sudo apt-get install libreadline-dev
sudo apt-get install libcunit1-dev

On Mac systems:

brew install automake
brew install autoconf
brew install readline
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
tar xfz RELEASE-FILE.TAR.GZ
cd RELEASE-DIR
./configure
make
sudo make install

Running unit tests by typing make check

Contribution

  • Instal prerequisites
  • Fork the repo
  • Run ./bootstrap.sh
  • Follow the building from source section.
  • commit and send pull request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].