Skip to content

Text 0.4.0 hamming

github-actions[bot] edited this page Aug 21, 2026 · 1 revision

Lodestar.Text 0.4.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

Hamming

Position-by-position comparison: the measure for fixed-width codes, where nothing ever shifts along.

Only for inputs that line up position by position: fixed-width codes, identifiers, checksums. A difference in length is added to the count rather than aligned away, so a single inserted character makes every position after it differ — which is exactly what Levenshtein exists to forgive.

Members

Member What it does
Hamming.Distance Counts the positions at which the two differ, then adds the difference in their lengths.
Hamming.NormalizedSimilarity Turns the distance into a score in [0, 1]: 1 - distance / max(len(a), len(b)).

Lodestar

Project

Clone this wiki locally