Paper wallet for Hush, which you can use with no internet access while wearing a tinfoil hat inside of a Faraday cage.
https://hush.is
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
1 year ago | |
---|---|---|
.. | ||
benches | 1 year ago | |
src | 1 year ago | |
tests | 1 year ago | |
.cargo-checksum.json | 1 year ago | |
CHANGELOG.md | 1 year ago | |
Cargo.toml | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
appveyor.yml | 1 year ago | |
dev | 1 year ago |
README.md
strsim-rs
![Windows build status](https://ci.appveyor.com/api/projects/status/ggue6i785618a39w?svg=true)
Rust implementations of string similarity metrics:
- Hamming
- Levenshtein - distance & normalized
- Optimal string alignment
- Damerau-Levenshtein - distance & normalized
- Jaro and Jaro-Winkler - this implementation of Jaro-Winkler does not limit the common prefix length
Installation
# Cargo.toml
[dependencies]
strsim = "0.8.0"
Documentation
You can change the version in the url to see the documentation for an older version in the changelog.
Usage
extern crate strsim;
use strsim::{hamming, levenshtein, normalized_levenshtein, osa_distance,
damerau_levenshtein, normalized_damerau_levenshtein, jaro,
jaro_winkler};
fn main() {
match hamming("hamming", "hammers") {
Ok(distance) => assert_eq!(3, distance),
Err(why) => panic!("{:?}", why)
}
assert_eq!(3, levenshtein("kitten", "sitting"));
assert!((normalized_levenshtein("kitten", "sitting") - 0.57142).abs() < 0.00001);
assert_eq!(3, osa_distance("ac", "cba"));
assert_eq!(2, damerau_levenshtein("ac", "cba"));
assert!((normalized_damerau_levenshtein("levenshtein", "löwenbräu") - 0.27272).abs() < 0.00001)
assert!((0.392 - jaro("Friedrich Nietzsche", "Jean-Paul Sartre")).abs() <
0.001);
assert!((0.911 - jaro_winkler("cheeseburger", "cheese fries")).abs() <
0.001);
}
Development
If you don't want to install Rust itself, you can run $ ./dev
for a
development CLI if you have Docker installed.
Benchmarks require a Nightly toolchain. They are run by cargo +nightly bench
.