bit_range

A small library for getting bits and ranges of bits from byte collections

1 unstable release

Uses old Rust 2015

0.1.0 Aug 29, 2015


Used in swf-headers

MIT license

3KB

bit-range

A small library for getting ranges of bits from collections of bytes.

Example

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));

lib.rs:

A helper library for handling getting ranges of bits from containers of bytes.

No runtime deps