strsim
Implementations of string similarity metrics. Includes Hamming, Levenshtein, OSA, Damerau-Levenshtein, Jaro, Jaro-Winkler, and Sørensen-Dice.
This package has a good security score with no known vulnerabilities.
Community Reviews
Dead simple string similarity metrics with zero learning curve
The documentation is minimal but entirely sufficient because the API surface is so small. Each function has clear examples showing both the basic usage and what the output represents. Error handling is minimal since most functions are infallible - `hamming` returns a Result for length mismatches, but that's intuitive and well-documented. When I needed to implement fuzzy search for a CLI tool, I had working code in minutes.
The only challenge is choosing which algorithm fits your use case, but that's a domain knowledge problem, not a crate problem. The README briefly explains each algorithm's characteristics, though you'll likely need external resources to deeply understand trade-offs between Levenshtein vs Jaro-Winkler for your specific needs.
Best for: Projects needing straightforward string similarity calculations without complexity or configuration overhead.
Avoid if: You need advanced features like phonetic matching, custom weights, or batch processing optimizations.
Clean, focused API with excellent ergonomics for string similarity
Documentation is concise but sufficient, with each function clearly explaining the algorithm and its use case. The crate compiles fast, has zero dependencies, and the panic-free design means you can confidently use it in production without defensive error handling. Type signatures are obvious and IDE autocomplete works flawlessly. I've used this in fuzzy search implementations, data deduplication pipelines, and user input matching - it just works.
The only minor friction is deciding which algorithm to use initially, though the docs do provide guidance. Once you understand your use case (typo tolerance vs. transpositions vs. phonetic similarity), the implementation is trivial.
Best for: Projects needing reliable, performant string similarity calculations with minimal dependencies and simple integration.
Avoid if: You need advanced features like phonetic matching, locale-aware comparisons, or fuzzy search indexing (use dedicated search libraries instead).
Dead simple string similarity - exactly what you need, nothing you don't
The documentation is minimal but sufficient - each function has clear examples showing input/output, and the algorithm names link to Wikipedia if you need theory. Error handling is non-existent because there's nothing to error on - if you pass valid strings, you get valid results. This simplicity makes debugging trivial; if your similarity scores look wrong, you're either using the wrong algorithm or have data issues, not library problems.
My only real complaint is the lack of guidance on which algorithm to use for different scenarios. The docs explain what each does but don't help you choose. Stack Overflow has some coverage, but you'll mostly rely on algorithm knowledge. Still, for a focused utility crate, it's refreshingly simple and reliable.
Best for: Projects needing straightforward string comparison with well-known algorithms and minimal abstraction.
Avoid if: You need phonetic matching, fuzzy search infrastructure, or guidance on algorithm selection for your domain.
Sign in to write a review
Sign In