Registry / utility / hamming

hamming

JSON →
library0.1.3rscratesunverified

Count ones, fast (aka popcount, hamming weight). This provides a performant popcount and bitwise hamming distance for a slice of bytes.

# Cargo.toml [dependencies] hamming = "0.1.3"
INSTALL
IMPORT
SIG · HAMMING
H
hamming
utilityrustv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

weight
use hamming::weight;

Count the number of 1 bits in a byte slice.

use hamming::weight; fn main() { let data = [0b10101010u8, 0b11110000]; let count = weight(&data); println!("Number of 1 bits: {}", count); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.1.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
hamming — cargo add hamming · libregistry