Crate hamming [−] [src]
A crate to count ones, fast (aka popcount, hamming weight).
Installation
Add this to your Cargo.toml
:
[dependencies]
hamming = "0.1"
Examples
assert_eq!(hamming::weight(&[1, 0xFF, 1, 0xFF]), 1 + 8 + 1 + 8);
Functions
weight |
Computes the Hamming
weight of |