Crates.io | uberbyte |
lib.rs | uberbyte |
version | 0.6.1 |
source | src |
created_at | 2023-09-21 18:51:37.652371 |
updated_at | 2023-10-03 18:56:55.275292 |
description | Bit manipulation for dummies |
homepage | |
repository | https://github.com/dejanfajfar/uberbyte.rs |
max_upload_size | |
id | 979793 |
size | 41,902 |
█████ █████ █████ ███████████ █████
░░███ ░░███ ░░███ ░░███░░░░░███ ░░███
░███ ░███ ░███████ ██████ ████████ ░███ ░███ █████ ████ ███████ ██████
░███ ░███ ░███░░███ ███░░███░░███░░███ ░██████████ ░░███ ░███ ░░░███░ ███░░███
░███ ░███ ░███ ░███░███████ ░███ ░░░ ░███░░░░░███ ░███ ░███ ░███ ░███████
░███ ░███ ░███ ░███░███░░░ ░███ ░███ ░███ ░███ ░███ ░███ ███░███░░░
░░████████ ████████ ░░██████ █████ ███████████ ░░███████ ░░█████ ░░██████
░░░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░ ░░░░░░░░░░░ ░░░░░███ ░░░░░ ░░░░░░
███ ░███
░░██████
░░░░░░
Bit manipulation for dummies
use uberbyte::UberByte;
fn main() {
let my_byte: UberByte = UberByte::from(42);
println!("{:b}", my_byte);
for index in 0..7 {
if my_byte.is_bit_set(index) {
println!("Bit on position {} is set", index);
} else {
println!("Bit on position {} is not set", index);
}
}
}
When working with a hardware interface I found it always tedious to work with individual bits. Checking if one or the other is set and setting them in return to communicate with the hardware.
So to make my life easier and add some convenience to the whole matter I made this.
Add UberByte to your project with:
cargo add uberbyte
Check out the Examples for some basic usage scenarios.
If you want to contribute you can do this in many ways
If you would like to introduce some changes to the project feel free to fork the project and do your changes.
It would then be nice if you create a pull request to reintegrate the changes you made.
Found a bug? Missing a feature?
Create a ticket at our (github issues)[https://github.com/dejanfajfar/uberbyte.rs/issues].
Any feedback that you do not want to put into the above form can just be dumped int our (github discussion page)[https://github.com/dejanfajfar/uberbyte.rs/discussions]
MIT
A great overview of the license is given at (tldrlegal.com)[https://www.tldrlegal.com/license/mit-license]
The license text can be found at (LICENSE)[https://github.com/dejanfajfar/uberbyte.rs/blob/main/LICENSE]