JavaScript
var pw = $('#pw').val();
$('#pw').on('keyup paste', function(ev) {
if ($(this).val() != pw && $(this).val() != '') {
data = zxcvbn($(this).val());
$('p').html("Estimated crack time: " + data.crack_time_display + "<br />Entropy: " + data.entropy);
pw = $(this).val();
}
});
(function() {
var w, o, q, x, J, K, L, M, N, O, P, Q, y, s, z, R, S, T, U, V, W;
P = function(b) {
var a, d;
d = [];
for (a in b) d.push(a);
return 0 === d.length
};
y = function(b, a) {
return b.push.apply(b, a)
};
V = function(b, a) {
var d, c, e, f, g;
f = b.split("");
g = [];
c = 0;
for (e = f.length; c < e; c++) d = f[c], g.push(a[d] || d);
return g.join("")
};
R = function(b) {
var a, d, c, e;
d = [];
c = 0;
for (e = A.length; c < e; c++) a = A[c], y(d, a(b));
return d.sort(function(b, a) {
return b.i - a.i || b.j - a.j
})
};
N = function(b, a) {
var d, c, e, f, g, h, i;
h = [];
e = b.length;
f = b.toLowerCase();
for (d = 0; 0 <= e ? d < e :
d > e; 0 <= e ? d++ : d--)
for (c = d; d <= e ? c < e : c > e; d <= e ? c++ : c--)
if (f.slice(d, c + 1 || 9E9) in a) i = f.slice(d, c + 1 || 9E9), g = a[i], h.push({
pattern: "dictionary",
i: d,
j: c,
token: b.slice(d, c + 1 || 9E9),
matched_word: i,
rank: g
});
return h
};
q = function(b) {
var a, d, c, e, f;
d = {};
a = 1;
e = 0;
for (f = b.length; e < f; e++) c = b[e], d[c] = a, a += 1;
return d
};
o = function(b, a) {
return function(d) {
var c, e, f;
c = N(d, a);
e = 0;
for (f = c.length; e < f; e++) d = c[e], d.dictionary_name = b;
return c
}
};
z = {
a: ["4", "@"],
b: ["8"],
c: ["(", "{", "[", "<"],
e: ["3"],
g: ["6", "9"],
i: ["1", "!", "|"],
l: ["1",
"|", "7"
],
o: ["0"],
s: ["$", "5"],
t: ["+", "7"],
...