phoenix_password 0.1.5 → 0.1.6
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/lib/phoenix_password/version.rb +1 -1
- data/lib/phoenix_password.rb +12 -21
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f6cab1c152e70c4126e91a443edc384f3dcada4
|
4
|
+
data.tar.gz: 30feab2c21937a24f8d5ec69954864457676ead0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db2b7725199dff32c9423d2d0009e88ca2621ea34143dd14155425cc8b1e9a4b74f75ae51b2f494f1659bdde5c57919c1a11d531004b632cef2c1c07df036ea2
|
7
|
+
data.tar.gz: 661f6981b00046b2f913766c8a1add26d68dc8c14f6db19eb8e77d0cbfe166b284785778805d73aeb74061ddea389c370351e319a4100ec866618acbe4454bf9
|
data/lib/phoenix_password.rb
CHANGED
@@ -115,15 +115,11 @@ class PhoenixPassword
|
|
115
115
|
generate_combinations(data) do |combinations|
|
116
116
|
combinations.each do |combination|
|
117
117
|
if matching_check({:combination=>combination,:match_limit=>info[:match_limit]})
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
if data[:extra_chars].nil?
|
122
|
-
matching_file.puts(combination)
|
123
|
-
elsif data[:iteration] >= 1
|
118
|
+
if info[:piped]
|
119
|
+
puts combination
|
120
|
+
else
|
124
121
|
matching_file.puts(combination)
|
125
|
-
|
126
|
-
end
|
122
|
+
end
|
127
123
|
matching +=1
|
128
124
|
end
|
129
125
|
end
|
@@ -186,18 +182,13 @@ class PhoenixPassword
|
|
186
182
|
combinations.each do |combination|
|
187
183
|
unique_chars=check_uniqueness(combination,uniqueness)
|
188
184
|
if unique_chars == combination.length-1
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
else
|
196
|
-
unique_file.puts(combination)
|
197
|
-
end
|
185
|
+
if info[:piped]
|
186
|
+
puts combination
|
187
|
+
else
|
188
|
+
unique_file.puts(combination)
|
189
|
+
end
|
190
|
+
unique_combs= unique_combs+1
|
198
191
|
end
|
199
|
-
unique_combs= unique_combs+1
|
200
|
-
end
|
201
192
|
end
|
202
193
|
end
|
203
194
|
data[:iteration] +=1 if !data[:iteration].nil?
|
@@ -362,7 +353,7 @@ class PhoenixPassword
|
|
362
353
|
|
363
354
|
previous_matches=0
|
364
355
|
previous_mult=0
|
365
|
-
i=
|
356
|
+
i=1
|
366
357
|
while i < (data[:cmb_length] -1)
|
367
358
|
if i == (data[:match_limit]-1)
|
368
359
|
previous_matches=base
|
@@ -373,7 +364,7 @@ class PhoenixPassword
|
|
373
364
|
else
|
374
365
|
temp_mult=previous_matches
|
375
366
|
previous_matches=(base**(i-1))+(previous_mult*(base-1))+(previous_matches*(base-1))
|
376
|
-
previous_mult=temp_mult
|
367
|
+
previous_mult=temp_mult
|
377
368
|
|
378
369
|
end
|
379
370
|
i+=1
|