| Crates.io | bitmask-cli |
| lib.rs | bitmask-cli |
| version | 0.1.0 |
| created_at | 2025-06-27 19:06:57.37991+00 |
| updated_at | 2025-06-27 19:06:57.37991+00 |
| description | A CLI tool for manipulating individual bits using commands like SET, CLEAR, TOGGLE, CHECK. |
| homepage | |
| repository | https://github.com/theolodocoder/bitmask-cli |
| max_upload_size | |
| id | 1729248 |
| size | 15,047 |
A fast and simple command-line utility for performing bitwise operations (SET, CLEAR, TOGGLE, CHECK) on individual bits of a byte (0โ255).
Perfect for learning, debugging, or manipulating binary values.
u8)cargo installcargo install bitmask-cli
cargo install --git https://github.com/theolodocoder/bitmask-cli
bitmask-cli --command <COMMAND> --number <NUMBER> --bit-index <INDEX>
| Flag | Description |
|---|---|
-c, --command |
Operation: set, clear, toggle, or check |
-n, --number |
A decimal (0โ255) byte value |
-b, --bit-index |
Bit index to manipulate (0โ7) |
bitmask-cli --command set --number 8 --bit-index 3
# Output:
# Original: 00001000 (8)
# Command: Set bit (3)
# Result: 00001000 (8)
bitmask-cli -c toggle -n 8 -b 3
# Result: 00000000 (0)
bitmask-cli -c check -n 8 -b 3
# Bit is set: true
Bitmasking is the technique of using bitwise operations to read or manipulate specific bits in a byte. For example:
SET: Turns a bit to 1CLEAR: Turns a bit to 0TOGGLE: Flips a bit from 1 to 0 or 0 to 1CHECK: Checks whether a bit is 1To run tests:
cargo test
Pull requests, bug reports, and ideas are welcome! If you're new to open source, this is a great project to get started with Rust.
This project is licensed under the MIT License. See LICENSE for details.
Made with โค๏ธ by Your Name