FastHamming: Fast Computation of Pairwise Hamming Distances

Pairwise Hamming distances are computed between the rows of a binary (0/1) matrix using highly optimized 'C' code. The input is an integer matrix where each row represents a binary feature vector and returns a symmetric integer matrix of pairwise distances. Internally, rows are bit-packed into 64-bit words for fast XOR-based comparisons, with hardware-accelerated popcount operations to count differences. 'OpenMP' parallelization ensures efficient performance for large matrices.

Getting started

Package details

AuthorRavi Varadhan [aut, cre]
MaintainerRavi Varadhan <ravi.varadhan@jhu.edu>
LicenseGPL-3
Version1.3
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("FastHamming")

Try the FastHamming package in your browser

Any scripts or data that you put into this service are public.

FastHamming documentation built on Aug. 21, 2026, 5:18 p.m.