Skip to content

Commit

Permalink
first changes to yxcvbn
Browse files Browse the repository at this point in the history
  • Loading branch information
Lia committed Mar 4, 2024
1 parent 61b6f35 commit c57d496
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
authors = ["Josh Holmer <[email protected]>"]
authors = [
"Lia an Haack <[email protected]>, Fabian Odenthal <[email protected]>",
]
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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion benches/zxcvbn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
2 changes: 1 addition & 1 deletion benches/zxcvbn_unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
2 changes: 2 additions & 0 deletions src/feedback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ pub(crate) fn get_feedback(score: u8, sequence: &[Match]) -> Option<Feedback> {
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) => {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/matching/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ lazy_static! {
table
};
static ref GRAPHS: HashMap<&'static str, &'static HashMap<char, Vec<Option<&'static str>>>> = {
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);
Expand Down
4 changes: 2 additions & 2 deletions src/time_estimates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//! # use std::error::Error;
//! #
//! # fn main() -> Result<(), Box<dyn Error>> {
//! 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);
Expand Down

0 comments on commit c57d496

Please sign in to comment.