intbits
cargo install intbits

intbits

Easy access to individual bits of integers.

by fusion-engineering

0.2.0 (see all)License:BSD-2-Clause
cargo install intbits
Readme

intbits

Easy access to individual bits of integers

use intbits::Bits;

assert_eq!(2.bit(0), false);
assert_eq!(2.bit(1), true);
assert_eq!(2.bit(2), false);

assert_eq!(0b1011u32.bits(0..2), 0b11);
assert_eq!(0b1011u32.bits(2..4), 0b10);

assert_eq!(0xFFu8.with_bit(3, false), 0xF7);
assert_eq!(0xFFu8.with_bits(4..8, 3), 0x3F);

See the documentation.

GitHub Stars

28

LAST COMMIT

2yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.2.0
2yrs ago
0.1.2
2yrs ago
0.1.1
3yrs ago
0.1.0
3yrs ago
No alternatives found
No tutorials found
Add a tutorial