zxcvbn 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/zxcvbn/frequency_lists.rb +1 -1
- data/lib/zxcvbn/matching.rb +2 -2
- data/lib/zxcvbn/scoring.rb +3 -3
- data/lib/zxcvbn/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13e1f178d40d7f161fe35df97e2c23ce212cb05862c35d3327528fb0126aed74
|
4
|
+
data.tar.gz: dea25dbbaa5c720b2459ca1b975a58382e532269763b4bd237ca698df6e53037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57c31fb079bf00272779c04fe99db2586af5455ef8b92e0e2822210ffff0270636e816198dfcb266c7fc68f148d7c2426b9f159f29baeee9c8d442be8dc73419
|
7
|
+
data.tar.gz: ec33e3cb2187db01195a8158db1076e0517f7f9a15f7e76565ae3382114f49e17240724ca44261cc37dadc3ba2feb7c569a0d0b2e72c95627f316be9ebb2b32c
|
data/CHANGELOG.md
CHANGED
data/lib/zxcvbn/matching.rb
CHANGED
@@ -16,7 +16,7 @@ module Zxcvbn
|
|
16
16
|
end
|
17
17
|
|
18
18
|
RANKED_DICTIONARIES_MAX_WORD_SIZE = RANKED_DICTIONARIES.transform_values do |word_scores|
|
19
|
-
word_scores.
|
19
|
+
word_scores.each_key.max_by(&:size)&.size || 0
|
20
20
|
end
|
21
21
|
|
22
22
|
GRAPHS = {
|
@@ -159,7 +159,7 @@ module Zxcvbn
|
|
159
159
|
len = password.length
|
160
160
|
password_lower = password.downcase
|
161
161
|
longest_word_size = RANKED_DICTIONARIES_MAX_WORD_SIZE.fetch(dictionary_name) do
|
162
|
-
ranked_dict.
|
162
|
+
ranked_dict.each_key.max_by(&:size)&.size || 0
|
163
163
|
end
|
164
164
|
search_width = [longest_word_size, len].min
|
165
165
|
(0...len).each do |i|
|
data/lib/zxcvbn/scoring.rb
CHANGED
@@ -9,7 +9,7 @@ module Zxcvbn
|
|
9
9
|
graph.each_value do |neighbors|
|
10
10
|
average += neighbors.count { |n| n }.to_f
|
11
11
|
end
|
12
|
-
average /= graph.
|
12
|
+
average /= graph.size.to_f
|
13
13
|
average
|
14
14
|
end
|
15
15
|
|
@@ -324,8 +324,8 @@ module Zxcvbn
|
|
324
324
|
# slightly different for keypad/mac keypad, but close enough
|
325
325
|
KEYPAD_AVERAGE_DEGREE = calc_average_degree(ADJACENCY_GRAPHS["keypad"]).freeze
|
326
326
|
|
327
|
-
KEYBOARD_STARTING_POSITIONS = ADJACENCY_GRAPHS["qwerty"].
|
328
|
-
KEYPAD_STARTING_POSITIONS = ADJACENCY_GRAPHS["keypad"].
|
327
|
+
KEYBOARD_STARTING_POSITIONS = ADJACENCY_GRAPHS["qwerty"].size
|
328
|
+
KEYPAD_STARTING_POSITIONS = ADJACENCY_GRAPHS["keypad"].size
|
329
329
|
|
330
330
|
def self.spatial_guesses(match)
|
331
331
|
if ["qwerty", "dvorak"].include?(match["graph"])
|
data/lib/zxcvbn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zxcvbn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 100% native Ruby 100% compatible port of Dropbox's zxcvbn.js
|
14
14
|
email:
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
rubygems_version: 3.5.
|
61
|
+
rubygems_version: 3.5.16
|
62
62
|
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: ''
|