6 stable releases

Uses old Rust 2015

1.0.5 Feb 22, 2021
1.0.4 Apr 16, 2019
1.0.3 Jul 6, 2017
1.0.1 Feb 15, 2017
1.0.0 Feb 9, 2016

#68 in Web programming

Download history 8870/week @ 2022-03-09 8543/week @ 2022-03-16 7962/week @ 2022-03-23 8388/week @ 2022-03-30 10145/week @ 2022-04-06 7559/week @ 2022-04-13 8757/week @ 2022-04-20 8768/week @ 2022-04-27 8703/week @ 2022-05-04 8716/week @ 2022-05-11 9396/week @ 2022-05-18 8424/week @ 2022-05-25 10582/week @ 2022-06-01 11006/week @ 2022-06-08 11198/week @ 2022-06-15 8592/week @ 2022-06-22

42,664 downloads per month
Used in 68 crates (16 directly)

MIT license

3KB

levenshtein.rs

Build Coverage Crate

Vladimir Levenshtein’s edit distance algorithm as a Rust library. There’s also a C library, C user command, and JavaScript module.

🎉 This is my first attempt at Rust!

Installation

Cargo:

[dependencies]
levenshtein = "1.0.5"

Usage

extern crate levenshtein;
use levenshtein::levenshtein;

fn main() {
    println!("{}", levenshtein("kitten", "sitting"));
}

Yields:

3

API

fn levenshtein(a: &str, b: &str) -> usize

Given two strings, returns the edit distance between them.

License

MIT © Titus Wormer

No runtime deps