strsim-rs
Rust implementations of string similarity metrics: Levenshtein, Jaro-Winkler, Damerau-Levenshtein, and more.
Repository Health
Technical Analysis
strsim (published as the strsim crate from the strsim-rs repository) is a Rust library implementing classic string similarity and edit-distance algorithms: Hamming, Levenshtein (with a normalized 0.0-1.0 variant), Optimal String Alignment, Damerau-Levenshtein (also normalized), Jaro and Jaro-Winkler, and Sørensen-Dice. Each metric ships as a plain function operating on &str inputs, plus generic versions that work over arbitrary sequences, not just strings.
Maintained under the RapidFuzz organization (which also maintains the popular rapidfuzz fuzzy-matching libraries across languages), strsim is a #[forbid(unsafe_code)] crate with no runtime dependencies, making it a lightweight building block for spell-checkers, fuzzy search, deduplication, and autocomplete features in Rust applications.
What You Get
levenshtein/normalized_levenshteinfor edit distance and a 0.0-1.0 similarity scorejaroandjaro_winklerfor name-matching-style similarity, tuned for short strings like namesdamerau_levenshtein/normalized_damerau_levenshteinandosa_distance(Optimal String Alignment) for transposition-aware edit distancehammingfor fixed-length equal-position mismatch counts, andsorensen_dicefor bigram-overlap similarity- Generic variants of each algorithm that operate on arbitrary sequences, not just
&str
Common Use Cases
- Fuzzy search and autocomplete features that need to rank near-matches by string similarity
- Spell-checking and “did you mean” suggestions based on edit distance to a dictionary
- Deduplicating near-identical records (names, addresses) using Jaro-Winkler or normalized Levenshtein thresholds
- Data-cleaning pipelines that score and merge fuzzy-matching entries across datasets
Under The Hood
Architecture — the entire crate is a single src/lib.rs (1,303 lines) organized as one function per metric (hamming, levenshtein, osa_distance, damerau_levenshtein, jaro, jaro_winkler, sorensen_dice) plus their normalized_* and generic counterparts, with shared internal helpers for the dynamic-programming distance matrices used by the edit-distance family; there’s no module hierarchy because the crate deliberately stays flat and dependency-free. Tech Stack — pure Rust, 2021 edition, MSRV 1.56, #[forbid(unsafe_code)] with zero runtime dependencies, published under the RapidFuzz GitHub organization alongside the broader rapidfuzz fuzzy-matching family used from Python, C++, and other languages. Code Quality — a dedicated tests/lib.rs integration test suite and benches/ directory back the implementation, with CI enforcing the unsafe forbidden badge; the library is stable and mature (117 total commits, MSRV frozen at 1.56), though development activity has slowed as the API has stabilized. API Design — every metric is exposed as a plain top-level function taking two &str arguments and returning a distance or a normalized f64 similarity score, with consistent naming (normalized_* prefix for the 0.0-1.0 variants) that makes the library trivial to pick up — cargo add strsim plus one function call covers the common case, with generic variants available for non-string sequence types when needed.
Used by 4 apps in this directory
fabro
Developer Tools · Devops
Define AI agent workflows as code graphs, route tasks across any LLM, and intervene only where it matters.
Firecrawl
AI Development · Developer Tools
Turn any website into clean, LLM-ready data with a single API call — no proxy headaches, no scraping complexity.
Handy
Productivity
Free, offline, open-source speech-to-text that pastes directly into any app on Windows, macOS, and Linux.
Meetily
Productivity · AI Assistants
Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.