bitmask-cli-0.1.0 is not a library.
๐งฎ Bitmask CLI
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.
๐ Features
- โ Set, clear, toggle, and check individual bits
- ๐ข Accepts decimal or binary numbers (
u8) - ๐ฆ Easily installable via
cargo install - ๐ Help command and built-in usage guide
- ๐งช Fully tested with unit tests
๐ฆ Installation
From crates.io
Or from GitHub
โ๏ธ Usage
Options:
| 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) |
๐ Examples
# Output:
# Original: 00001000 (8)
# Command: Set bit (3)
# Result: 00001000 (8)
# Result: 00000000 (0)
# Bit is set: true
๐ก What Are Bitmasks?
Bitmasking is the technique of using bitwise operations to read or manipulate specific bits in a byte. For example:
SET: Turns a bit to1CLEAR: Turns a bit to0TOGGLE: Flips a bit from1to0or0to1CHECK: Checks whether a bit is1
๐งช Running Tests
To run tests:
๐ค Contributing
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.
๐ License
This project is licensed under the MIT License. See LICENSE for details.
โจ Author
Made with โค๏ธ by Your Name