1 unstable release
0.1.3 | Jul 22, 2020 |
---|---|
0.1.2 |
|
0.1.1 |
|
0.1.0 |
|
#2289 in Data structures
48 downloads per month
12KB
197 lines
simple-bitrange
Simple manipulation of bit ranges.
Documentation
Change log
License
Licensed under either of
-
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
-
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
A simple bit range crate
This crate aims to facilitate the extraction of bits in a small, simple crate. While it does not have as many bells and whistle as many other crates, simplicity is the key here.
Usage examples
Extract bits from slice of bytes:
let y: u32 = 0b00001111_11110000_01010000_00001010;
let p: &[u8] = &y.to_le_bytes();
let ret: u32 = p.range_read_le(..);
assert_eq!(ret, y);