Crates.io | bit_range |
lib.rs | bit_range |
version | 0.1.0 |
source | src |
created_at | 2015-08-29 04:12:02.720637 |
updated_at | 2015-12-11 23:56:18.321051 |
description | A small library for getting bits and ranges of bits from byte collections |
homepage | |
repository | https://github.com/iirelu/bit-range |
max_upload_size | |
id | 2949 |
size | 2,960 |
A small library for getting ranges of bits from collections of bytes.
extern crate bit_range;
use bit_range::BitRange;
let vec = vec![0b0110_1101, 0b0011_0100];
let slice = [0b1101_1010, 0b0000_0010, 0b1111_1111];
println!("{:0b}", vec.get_bit_range(1..5));
assert_eq!(vec.get_bit_range(1..9), slice.get_bit_range(0..8));