# Crate bigwise [−] [src]

Bitwise operations on fixed-size, arbitrary big buffer of bytes.

The primitive types `u8`

, `u16`

, `u32`

and `u64`

are very useful types,
when one needs to perform boolean algebra on many bits at once (bitwise
operations).

This crate complements these primitive types, with subsequent power-of-two
sizes: `Bw128`

, `Bw256`

, etc. These types are all `Copy`

(that is, they can
be trivially copied as raw memory), and their size is really the size given
by their names (`Bw256`

takes 256 bits). You may be quickly limited by
Rust's default stack size if you store these types directly on the stack.
Don't forget to box your values if you want them to live on the heap!

If the types provided are not enough, you can easily define your own by
creating an alias to a `BwPair<X>`

. Only power-of-two sizes are supported.

# Examples

use bigwise::{Bigwise, Bw128}; let b1 = Bw128::from_bytes(&[0b00110110, 0b10001101]); let b2 = b1 << 90; let b3 = Bw128::full() >> 60; let b4 = b1.rotate_right(5); let b5 = (b2 & !b3) | b4; print!("{:?}", b5);

## Structs

BitsIter |
An iterator over the bits. |

Bw64 |
A |

BwPair |
Combines two |

## Traits

Bigwise |
A type that supports bitwise operations. |

## Type Definitions

Bw128 |
A |

Bw256 |
A |

Bw512 |
A |

Bw128k |
A |

Bw16k |
A |

Bw1M |
A |

Bw1k |
A |

Bw256k |
A |

Bw2k |
A |

Bw32k |
A |

Bw4k |
A |

Bw512k |
A |

Bw64k |
A |

Bw8k |
A |