zxcvbn 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 109b1843277c9742ff72f5a6fabda24301fcc6b37d2cdd2075cea0f7e2c91926
4
- data.tar.gz: d306b716657970d9f14525e5a4eaa0e8e19c1a21183fb09ff0f7ebb488f81337
3
+ metadata.gz: 50df44a0d9bdff1e7b99f5ef1fac71d95a5bc23bf1d01d302bd23a8d6e027d1e
4
+ data.tar.gz: 4f7c36d4c57b193b72b4964e002931cf665851b8bfb13ccfd7b0f7ea74773840
5
5
  SHA512:
6
- metadata.gz: 6bd52c6440b10692b22a3c1b10e13fd9c84305ca66c455f90361fb5d20962926676b19402c968dc4d1a17be45d95c6da05828fc2f9e7244b0e9555cf9984203d
7
- data.tar.gz: 30189e55b622422c4222034eaf5212f9ff2f7d22a9dd5da35bc724372681b43d1e542b91805310943e8a2be37481fd8447c99b9d94924a3cd11d40b9c0107873
6
+ metadata.gz: 7210bdcd7b53a785cdc046b6886ba99f02da09905638eacf4f8acbebbd7c3f4e57121f9bf9e49650c2aae2c1b1a782bc7736edfc378ca40d2a5082ce4682133d
7
+ data.tar.gz: 600e750ee98acd0c1fa070cdf7144324165a894eb42eeff336e5e59d57be8e8c08fe06f9bb70ef5827208077febe0039783d5ef16aecde2eb4458fffa7594eaa
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.5
3
3
  NewCops: enable
4
+ SuggestExtensions: false
4
5
 
5
6
  Layout/EndAlignment:
6
7
  EnforcedStyleAlignWith: start_of_line
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [Unreleased]
1
+ ## [0.1.4] - 2021-05-16
2
+
3
+ - Bunch of fixes, eall example passwords included have same result as js version.
4
+ - consistent code style applied.
5
+
2
6
 
3
7
  ## [0.1.0] - 2021-05-16
4
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zxcvbn (0.1.4)
4
+ zxcvbn (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -24,45 +24,45 @@ Or install it yourself as:
24
24
  ```
25
25
  Zxcvbn.zxcvbn("password")
26
26
  => {
27
- :password => "pasword",
28
- :guesses => 3566,
29
- :guesses_log10 => 3.5521813388393357,
30
- :sequence => [
27
+ "password" => "password",
28
+ "guesses" => 3,
29
+ "guesses_log10" => 0.47712125471966244,
30
+ "sequence" => [
31
31
  {
32
- :pattern => "dictionary",
33
- :i => 0,
34
- :j => 6,
35
- :token => "pasword",
36
- :matched_word => "pasword",
37
- :rank => 3565,
38
- :dictionary_name => "passwords",
39
- :reversed => false,
40
- :l33t => false,
41
- :base_guesses => 3565,
42
- :uppercase_variations => 1,
43
- :l33t_variations => 1,
44
- :guesses => 3565,
45
- :guesses_log10 => 3.5520595341878844
32
+ "pattern" => "dictionary",
33
+ "i" => 0,
34
+ "j" => 7,
35
+ "token" => "password",
36
+ "matched_word" => "password",
37
+ "rank" => 2,
38
+ "dictionary_name" => "passwords",
39
+ "reversed" => false,
40
+ "l33t" => false,
41
+ "base_guesses" => 2,
42
+ "uppercase_variations" => 1,
43
+ "l33t_variations" => 1,
44
+ "guesses" => 2,
45
+ "guesses_log10" => 0.3010299956639812
46
46
  }
47
47
  ],
48
- :calc_time => 0,
49
- :crack_times_seconds => {
50
- :online_throttling_100_per_hour => 128376.0,
51
- :online_no_throttling_10_per_second => 356.6,
52
- :offline_slow_hashing_1e4_per_second => 0.3566,
53
- :offline_fast_hashing_1e10_per_second => 3.566e-07
48
+ "calc_time" => 1,
49
+ "crack_times_seconds" => {
50
+ "online_throttling_100_per_hour" => 108.0,
51
+ "online_no_throttling_10_per_second" => 0.3,
52
+ "offline_slow_hashing_1e4_per_second" => 0.0003,
53
+ "offline_fast_hashing_1e10_per_second" => 3.0e-10},
54
+ "crack_times_display" => {
55
+ "online_throttling_100_per_hour" => "2 minutes",
56
+ "online_no_throttling_10_per_second" => "less than a second",
57
+ "offline_slow_hashing_1e4_per_second" => "less than a second",
58
+ "offline_fast_hashing_1e10_per_second" => "less than a second"
54
59
  },
55
- :crack_times_display => {
56
- :online_throttling_100_per_hour => "1 day",
57
- :online_no_throttling_10_per_second => "6 minutes",
58
- :offline_slow_hashing_1e4_per_second => "less than a second",
59
- :offline_fast_hashing_1e10_per_second => "less than a second"
60
- },
61
- :score => 1,
62
- :feedback =>
63
- {
64
- :warning => "This is a very common password",
65
- :suggestions => ["Add another word or two. Uncommon words are better."]
60
+ "score" => 0,
61
+ "feedback" => {
62
+ "warning" => "This is a top-10 common password",
63
+ "suggestions" => [
64
+ "Add another word or two. Uncommon words are better."
65
+ ]
66
66
  }
67
67
  }
68
68
  ```
@@ -125,6 +125,10 @@ module Zxcvbn
125
125
  optimal["g"][k][l] = g
126
126
  optimal["m"][k][l] = m
127
127
  optimal["pi"][k][l] = pi
128
+
129
+ optimal["g"][k] = optimal["g"][k].sort.to_h
130
+ optimal["m"][k] = optimal["m"][k].sort.to_h
131
+ optimal["pi"][k] = optimal["pi"][k].sort.to_h
128
132
  end
129
133
 
130
134
  # helper: make bruteforce match objects spanning i to j, inclusive.
@@ -148,7 +152,6 @@ module Zxcvbn
148
152
  # leads to new bests.
149
153
  m = make_bruteforce_match.call(i, k)
150
154
  optimal["m"][i - 1].each do |l, last_m|
151
- l = l.to_i
152
155
  # corner: an optimal sequence will never have two adjacent bruteforce matches.
153
156
  # it is strictly better to have a single bruteforce match spanning the same region:
154
157
  # same contribution to the guess product with a lower length.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zxcvbn
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
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
4
+ version: 0.1.5
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-05-17 00:00:00.000000000 Z
11
+ date: 2021-05-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby port of Dropbox's zxcvbn.js
14
14
  email: