Crate bitwise [] [src]

bitwise offers portable high-level manipulation algorithms (@github,

The algorithms:

  • have descriptive names to ease reading code that performs bit manipulations,
  • often optimize to perfect assembly code (and always on nightly by using the bitintr crate),
  • works on stable unstable only :( due to specialization for now.


extern crate bitwise;
use bitwise::word::*;

fn main() {
    let u = outer_perfect_shuffle(0b_1001_1111u8);
    let v = inner_perfect_shuffle(0b_1001_1111u8);
    let w = u.copy_bit(4u8, v, 3u8);
    assert_eq!(w.parallel_bits_deposit(u), 0b_1001_0011u8);


pub extern crate bitintr;
pub use word::*;



Algorithms for single words (u8...u64).