Git Product home page Git Product logo

bitwise's Introduction

Portable high-level bitwise manipulation algorithms

crates.io version Travis build status Coveralls.io code coverage Docs License

We do what we must because we can.

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.

Example

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

Supported compilers

The minimum required rustc version is >= 1.13.0.

Requires unstable for now.

Performance

Some algorithms like the Morton Z-Curve encoding/decoding routines switch implementation at compile-time depending on target features (like BMI2 support).

License

Licensed under the MIT license.

Acknowledgments

The giants that came before us:

Contribution

Yes please! Just note that all contributions shall be licensed as above without any additional terms or conditions. The following people have contributed code to this library:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.