Crates.io | biterator |
lib.rs | biterator |
version | 0.3.0 |
source | src |
created_at | 2022-01-17 19:15:23.760742 |
updated_at | 2022-01-21 14:35:16.364142 |
description | A crate for iterating over individual bits in a byte stream |
homepage | |
repository | https://github.com/thomascastleman/biterator.git |
max_upload_size | |
id | 515732 |
size | 11,766 |
This crate provides Biterator
, an iterator over individual bits in a source of bytes.
use biterator::{Biterator, Bit::*};
let bytes = [0b00001111, 0b10101011];
let b = Biterator::new(&bytes);
assert_eq!(
b.collect::<Vec<_>>(),
vec![
Zero, Zero, Zero, Zero, One, One, One, One,
One, Zero, One, Zero, One, Zero, One, One,
]
);