zxcvbn
Advanced tools
Comparing version 4.0.1 to 4.1.0
// Generated by CoffeeScript 1.10.0 | ||
var matching, scoring, time, time_estimates, zxcvbn; | ||
var feedback, matching, scoring, time, time_estimates, zxcvbn; | ||
@@ -10,2 +10,4 @@ matching = require('./matching'); | ||
feedback = require('./feedback'); | ||
time = function() { | ||
@@ -37,2 +39,3 @@ return (new Date()).getTime(); | ||
} | ||
result.feedback = feedback.get_feedback(result.score, result.sequence); | ||
return result; | ||
@@ -39,0 +42,0 @@ }; |
// Generated by CoffeeScript 1.10.0 | ||
var DATE_MAX_YEAR, DATE_MIN_YEAR, DATE_SPLITS, GRAPHS, L33T_TABLE, RANKED_DICTIONARIES, REGEXEN, REGEX_PRECEDENCE, SEQUENCES, adjacency_graphs, build_ranked_dict, frequency_lists, matching, scoring, | ||
var DATE_MAX_YEAR, DATE_MIN_YEAR, DATE_SPLITS, GRAPHS, L33T_TABLE, RANKED_DICTIONARIES, REGEXEN, SEQUENCES, adjacency_graphs, build_ranked_dict, frequency_lists, matching, scoring, | ||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
@@ -60,21 +60,5 @@ | ||
REGEXEN = { | ||
alphanumeric: /[a-zA-Z0-9]{2,}/g, | ||
alpha: /[a-zA-Z]{2,}/g, | ||
alpha_lower: /[a-z]{2,}/g, | ||
alpha_upper: /[A-Z]{2,}/g, | ||
digits: /\d{2,}/g, | ||
symbols: /[\W_]{2,}/g, | ||
recent_year: /19\d\d|200\d|201\d/g | ||
}; | ||
REGEX_PRECEDENCE = { | ||
alphanumeric: 0, | ||
alpha: 1, | ||
alpha_lower: 2, | ||
alpha_upper: 2, | ||
digits: 2, | ||
symbols: 2, | ||
recent_year: 3 | ||
}; | ||
DATE_MAX_YEAR = 2050; | ||
@@ -161,3 +145,4 @@ | ||
dictionary_name: dictionary_name, | ||
reversed: false | ||
reversed: false, | ||
l33t: false | ||
}); | ||
@@ -510,3 +495,3 @@ } | ||
regex_match: function(password, _regexen) { | ||
var get_key, highest_precedence, key, len1, match, matches, name, o, precedence, precedence_map, regex, rx_match, token; | ||
var matches, name, regex, rx_match, token; | ||
if (_regexen == null) { | ||
@@ -531,21 +516,3 @@ _regexen = REGEXEN; | ||
} | ||
precedence_map = {}; | ||
get_key = function(match) { | ||
return match.i + "-" + match.j; | ||
}; | ||
for (o = 0, len1 = matches.length; o < len1; o++) { | ||
match = matches[o]; | ||
key = get_key(match); | ||
precedence = REGEX_PRECEDENCE[match.regex_name]; | ||
if (key in precedence_map) { | ||
highest_precedence = precedence_map[key]; | ||
if (highest_precedence >= precedence) { | ||
continue; | ||
} | ||
} | ||
precedence_map[key] = precedence; | ||
} | ||
return this.sorted(matches.filter(function(match) { | ||
return precedence_map[get_key(match)] === REGEX_PRECEDENCE[match.regex_name]; | ||
})); | ||
return this.sorted(matches); | ||
}, | ||
@@ -552,0 +519,0 @@ date_match: function(password) { |
@@ -47,3 +47,3 @@ // Generated by CoffeeScript 1.10.0 | ||
century = year * 100; | ||
ref = seconds < 1 ? [null, 'subsecond'] : seconds < minute ? [seconds, seconds + " second"] : seconds < hour ? (base = Math.round(seconds / minute), [base, base + " minute"]) : seconds < day ? (base = Math.round(seconds / hour), [base, base + " hour"]) : seconds < month ? (base = Math.round(seconds / day), [base, base + " day"]) : seconds < year ? (base = Math.round(seconds / month), [base, base + " month"]) : seconds < century ? (base = Math.round(seconds / year), [base, base + " year"]) : [null, 'centuries'], display_num = ref[0], display_str = ref[1]; | ||
ref = seconds < 1 ? [null, 'less than a second'] : seconds < minute ? (base = Math.round(seconds), [base, base + " second"]) : seconds < hour ? (base = Math.round(seconds / minute), [base, base + " minute"]) : seconds < day ? (base = Math.round(seconds / hour), [base, base + " hour"]) : seconds < month ? (base = Math.round(seconds / day), [base, base + " day"]) : seconds < year ? (base = Math.round(seconds / month), [base, base + " month"]) : seconds < century ? (base = Math.round(seconds / year), [base, base + " year"]) : [null, 'centuries'], display_num = ref[0], display_str = ref[1]; | ||
if ((display_num != null) && display_num !== 1) { | ||
@@ -50,0 +50,0 @@ display_str += 's'; |
{ | ||
"name": "zxcvbn", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "realistic password strength estimation", | ||
@@ -5,0 +5,0 @@ "author": "Dan Wheeler", |
@@ -175,2 +175,12 @@ ``` | ||
result.feedback # verbal feedback to help choose better passwords. set when score <= 2. | ||
result.feedback.warning # explains what's wrong, eg. 'this is a top-10 common password'. | ||
# not always set -- sometimes an empty string | ||
result.feedback.suggestions # a possibly-empty list of suggestions to help choose a less | ||
# guessable password. eg. 'Add another word or two' | ||
result.suggestions | ||
result.sequence # the list of patterns that zxcvbn based the | ||
@@ -256,7 +266,7 @@ # entropy calculation on. | ||
Dropbox for supporting open source! | ||
[Dropbox](https://dropbox.com) for supporting open source! | ||
Leah Culver and Ryan Pearl for porting zxcvbn to [Objective C](https://github.com/dropbox/zxcvbn-ios) and [python](https://github.com/dropbox/python-zxcvbn). | ||
Mark Burnett for releasing his [10k top passwords list](http://xato.net/passwords/more-top-worst-passwords) and for his 2006 book, [Perfect Passwords: Selection, Protection, Authentication](http://www.amazon.com/Perfect-Passwords-Selection-Protection-Authentication/dp/1597490415). | ||
Mark Burnett for releasing his [10k top passwords list](http://xato.net/passwords/more-top-worst-passwords) and for his 2005 book, [Perfect Passwords: Selection, Protection, Authentication](http://www.amazon.com/Perfect-Passwords-Selection-Protection-Authentication/dp/1597490415). | ||
@@ -263,0 +273,0 @@ Wiktionary contributors for building a [frequency list of English](http://en.wiktionary.org/wiki/Wiktionary:Frequency_lists) as used in television and movies. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3055917
29
6965
276