diff --git a/Cargo.toml b/Cargo.toml index 9965217..a5fe731 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] -authors = ["Josh Holmer "] +authors = [ + "Lia an Haack , Fabian Odenthal ", +] description = "An entropy-based password strength estimator, originally for Javascript by Dropbox." -documentation = "https://docs.rs/zxcvbn" -homepage = "https://github.com/shssoichiro/zxcvbn-rs" license = "MIT" -name = "zxcvbn" -repository = "https://github.com/shssoichiro/zxcvbn-rs" +name = "yxcvbn" +repository = "https://github.com/Identeco/yxcvbn" version = "2.2.2" edition = "2021" rust-version = "1.63" @@ -14,9 +14,9 @@ rust-version = "1.63" maintenance = { status = "passively-maintained" } [dependencies] -derive_builder = { version = "0.12.0", optional = true } -fancy-regex = "0.11.0" -itertools = "0.10.0" +derive_builder = { version = "0.20.0", optional = true } +fancy-regex = "0.13.0" +itertools = "0.12.1" lazy_static = "1.3" quick-error = "2.0" regex = "1" @@ -36,7 +36,7 @@ version = "1" [dev-dependencies] quickcheck = "1.0.0" serde_json = "1" -criterion = "0.4" +criterion = "0.5.1" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/README.md b/README.md index 69a503a..ad43c00 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# zxcvbn +# yxcvbn [![Version](https://img.shields.io/crates/v/zxcvbn.svg)](https://crates.io/crates/zxcvbn) [![License](https://img.shields.io/crates/l/zxcvbn.svg)](https://github.com/shssoichiro/zxcvbn-rs/blob/master/LICENSE) @@ -41,9 +41,9 @@ Full API documentation can be found [here](https://docs.rs/zxcvbn/*/zxcvbn/). Usage example: ```rust -extern crate zxcvbn; +extern crate yxcvbn; -use zxcvbn::zxcvbn; +use yxcvbn::zxcvbn; fn main() { let estimate = zxcvbn("correcthorsebatterystaple", &[]).unwrap(); diff --git a/benches/zxcvbn.rs b/benches/zxcvbn.rs index 85fedd5..46d8cee 100644 --- a/benches/zxcvbn.rs +++ b/benches/zxcvbn.rs @@ -2,7 +2,7 @@ use criterion::black_box; use criterion::Criterion; use criterion::{criterion_group, criterion_main}; -use zxcvbn::zxcvbn; +use yxcvbn::zxcvbn; pub fn bench_zxcvbn(c: &mut Criterion) { c.bench_function("zxcvbn", |b| { diff --git a/benches/zxcvbn_unicode.rs b/benches/zxcvbn_unicode.rs index fd846fd..5932951 100644 --- a/benches/zxcvbn_unicode.rs +++ b/benches/zxcvbn_unicode.rs @@ -2,7 +2,7 @@ use criterion::black_box; use criterion::Criterion; use criterion::{criterion_group, criterion_main}; -use zxcvbn::zxcvbn; +use yxcvbn::zxcvbn; pub fn bench_zxcvbn_unicode(c: &mut Criterion) { c.bench_function("zxcvbn_unicode", |b| { diff --git a/src/feedback.rs b/src/feedback.rs index 0d0c28a..2ea4014 100644 --- a/src/feedback.rs +++ b/src/feedback.rs @@ -179,6 +179,7 @@ pub(crate) fn get_feedback(score: u8, sequence: &[Match]) -> Option { Some(feedback) } +/// helper function to get feedback for a match fn get_match_feedback(cur_match: &Match, is_sole_match: bool) -> Feedback { match cur_match.pattern { MatchPattern::Dictionary(ref pattern) => { @@ -228,6 +229,7 @@ fn get_match_feedback(cur_match: &Match, is_sole_match: bool) -> Feedback { } } +/// helper function to get dictionary feedback for a match fn get_dictionary_match_feedback( cur_match: &Match, pattern: &DictionaryPattern, diff --git a/src/matching/mod.rs b/src/matching/mod.rs index d19e37d..78a5a51 100644 --- a/src/matching/mod.rs +++ b/src/matching/mod.rs @@ -71,7 +71,7 @@ lazy_static! { table }; static ref GRAPHS: HashMap<&'static str, &'static HashMap>>> = { - let mut table = HashMap::with_capacity(4); + let mut table = HashMap::with_capacity(5); table.insert("qwerty", &*super::adjacency_graphs::QWERTY); table.insert("qwertz", &*super::adjacency_graphs::QWERTZ); table.insert("dvorak", &*super::adjacency_graphs::DVORAK); diff --git a/src/time_estimates.rs b/src/time_estimates.rs index e2cdee8..3ac621f 100644 --- a/src/time_estimates.rs +++ b/src/time_estimates.rs @@ -6,8 +6,8 @@ //! # use std::error::Error; //! # //! # fn main() -> Result<(), Box> { -//! use zxcvbn::zxcvbn; -//! use zxcvbn::time_estimates::CrackTimes; +//! use yxcvbn::zxcvbn; +//! use yxcvbn::time_estimates::CrackTimes; //! //! let entropy = zxcvbn("password123", &[])?; //! assert_eq!(entropy.crack_times().guesses(), 596);