zxcvbn 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/zxcvbn/matching.rb +2 -6
- data/lib/zxcvbn/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 497a8237437937a17ce899c92181dcc11f32e164ca5515ba2739ac02e59f79b2
|
4
|
+
data.tar.gz: 0e0ee12a70d1814db3178c9d925a43b22036c3c5c1444dd2ed38873c5c5686a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab0bf4b0709602f08bdb20caae26f124487c3dac8d1f35ef04fb728a0bda822e68ad35db065d28be15745a7c61705ecb402cc7fb463209d8bbc24ca3d8edf379
|
7
|
+
data.tar.gz: e03692c3985a020195e1304451dcd3c91b847d9ef2c391ba62ce61b33f08251a73f195877618a649bd847dd4736769de0b31779a5a61e6b7ab2b23ca946cda81
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## [0.1.7] - 2021-06-12
|
2
|
+
- Ported original specs
|
3
|
+
- Fix difference found on enumerate_l33t_subs
|
4
|
+
- Setup to also test against current versions of ruby
|
5
|
+
|
1
6
|
## [0.1.6] - 2021-05-28
|
2
7
|
- Added test methods for compatibility with zxcvbn-js and zxcvbn-ruby.
|
3
8
|
|
@@ -9,7 +14,6 @@
|
|
9
14
|
- Bunch of fixes, all example passwords included have same result as js version.
|
10
15
|
- consistent code style applied.
|
11
16
|
|
12
|
-
|
13
17
|
## [0.1.0] - 2021-05-16
|
14
18
|
|
15
19
|
- Initial release
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://badge.fury.io/rb/zxcvbn)
|
4
4
|
[](https://travis-ci.com/formigarafa/zxcvbn-rb)
|
5
5
|
|
6
|
-
Ruby port of Dropbox's [zxcvbn.js]
|
6
|
+
Ruby port of Dropbox's [zxcvbn.js](https://github.com/dropbox/zxcvbn) JavaScript library running completely in Ruby (no need to load execjs or libv8).
|
7
7
|
|
8
8
|
The intention is to provide an option 100% Ruby solution with all the same features and same results (or as close to the original JS function as possible).
|
9
9
|
|
data/lib/zxcvbn/matching.rb
CHANGED
@@ -112,10 +112,6 @@ module Zxcvbn
|
|
112
112
|
]
|
113
113
|
}.freeze
|
114
114
|
|
115
|
-
def self.empty(obj)
|
116
|
-
obj.empty?
|
117
|
-
end
|
118
|
-
|
119
115
|
def self.translate(string, chr_map)
|
120
116
|
string.chars.map { |chr| chr_map[chr] || chr }.join
|
121
117
|
end
|
@@ -250,7 +246,7 @@ module Zxcvbn
|
|
250
246
|
end
|
251
247
|
end
|
252
248
|
if dup_l33t_index == -1
|
253
|
-
sub_extension = sub
|
249
|
+
sub_extension = sub + [[l33t_chr, first_key]]
|
254
250
|
next_subs << sub_extension
|
255
251
|
else
|
256
252
|
sub_alternative = sub.dup
|
@@ -283,7 +279,7 @@ module Zxcvbn
|
|
283
279
|
def self.l33t_match(password, _ranked_dictionaries = RANKED_DICTIONARIES, _l33t_table = L33T_TABLE)
|
284
280
|
matches = []
|
285
281
|
enumerate_l33t_subs(relevant_l33t_subtable(password, _l33t_table)).each do |sub|
|
286
|
-
break if empty
|
282
|
+
break if sub.empty? # corner case: password has no relevant subs.
|
287
283
|
|
288
284
|
subbed_password = translate(password, sub)
|
289
285
|
dictionary_match(subbed_password, _ranked_dictionaries).each do |match|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-12 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:
|