phoenix_password 0.1.4 → 0.1.5
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/.gitignore +5 -0
- data/lib/phoenix_password/version.rb +1 -1
- data/lib/phoenix_password.rb +62 -33
- metadata +2 -8
- data/.travis.yml +0 -5
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/phoenix_password-0.1.2.gem +0 -0
- data/phoenix_password-0.1.3.gem +0 -0
- data/phoenix_password.gemspec +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1807205fb4c33dec3f0d8f0f0a76a8e51546e6bc
|
4
|
+
data.tar.gz: a69879613f2803b82a5d306c850a51217cae4585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7fdc581e56666262e5a50d23daf10a94eef66bf7eb343cb7fe4bbef1f523eacc323f02d2973de579477cc5b94efc8a906fcfe3f0f1b2d879b716c245a968098
|
7
|
+
data.tar.gz: 90c74efe4204a8f229a5f5ccd6c19b625c1163e57e49c47b03d0e1e00ac02f94f576277df7027f9900bc35b668867792d0f890bfb3e28e80b2b77609a5aaf0d3
|
data/.gitignore
CHANGED
data/lib/phoenix_password.rb
CHANGED
@@ -12,7 +12,7 @@ class PhoenixPassword
|
|
12
12
|
possible_combinations=characters.length**combination_length
|
13
13
|
chars_used=Array.new(data[:cmb_length],0)
|
14
14
|
|
15
|
-
while i < possible_combinations
|
15
|
+
while i < possible_combinations/characters.length
|
16
16
|
x=1
|
17
17
|
change_count=1
|
18
18
|
while x < combination_length
|
@@ -34,12 +34,37 @@ class PhoenixPassword
|
|
34
34
|
y+=1
|
35
35
|
end
|
36
36
|
|
37
|
+
combinations=[]
|
37
38
|
if data[:extra_chars].nil? || data[:iteration] == 0
|
38
|
-
|
39
|
+
combinations.<<(combination.join())
|
40
|
+
if combination.last != characters.first
|
41
|
+
reverse_comb=combination.reverse
|
42
|
+
combinations.<<(reverse_comb.join())
|
43
|
+
reverse_comb.pop
|
44
|
+
reverse_comb=reverse_comb.join()
|
45
|
+
characters.each do |char|
|
46
|
+
next if char == characters.first
|
47
|
+
combinations.<<("%s%s"%[reverse_comb,char])
|
48
|
+
end
|
49
|
+
end
|
39
50
|
else
|
40
|
-
|
51
|
+
combinations << combination.join() if combination.include?(characters.last)
|
52
|
+
if combination.last != characters.first
|
53
|
+
reverse_comb=combination.reverse
|
54
|
+
reverse_comb.pop
|
55
|
+
reverse_comb=reverse_comb.join
|
56
|
+
if reverse_comb.include?(characters.last)
|
57
|
+
characters.each do |char|
|
58
|
+
combinations.<<("%s%s"%[reverse_comb,char])
|
59
|
+
end
|
60
|
+
else
|
61
|
+
combinations.<<("%s%s"%[reverse_comb,characters.last])
|
62
|
+
end
|
63
|
+
end
|
41
64
|
end
|
42
65
|
|
66
|
+
yield(combinations) if combinations.length >= 1
|
67
|
+
|
43
68
|
z=combination_length-1
|
44
69
|
while 1 < z
|
45
70
|
if z == combination_length-1
|
@@ -87,20 +112,22 @@ class PhoenixPassword
|
|
87
112
|
|
88
113
|
matching=0
|
89
114
|
begin
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
end
|
101
|
-
matching +=1
|
115
|
+
generate_combinations(data) do |combinations|
|
116
|
+
combinations.each do |combination|
|
117
|
+
if matching_check({:combination=>combination,:match_limit=>info[:match_limit]})
|
118
|
+
if info[:piped]
|
119
|
+
puts combination
|
120
|
+
elsif !matching_file.nil?
|
121
|
+
if data[:extra_chars].nil?
|
122
|
+
matching_file.puts(combination)
|
123
|
+
elsif data[:iteration] >= 1
|
124
|
+
matching_file.puts(combination)
|
102
125
|
end
|
126
|
+
end
|
127
|
+
matching +=1
|
103
128
|
end
|
129
|
+
end
|
130
|
+
end
|
104
131
|
data[:iteration]+=1 unless data[:iteration].nil?
|
105
132
|
char_sum +=1
|
106
133
|
rescue => e
|
@@ -155,24 +182,26 @@ class PhoenixPassword
|
|
155
182
|
unique_combs=0
|
156
183
|
uniqueness=info[:uniqueness_type]
|
157
184
|
begin
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
185
|
+
generate_combinations(data) do |combinations|
|
186
|
+
combinations.each do |combination|
|
187
|
+
unique_chars=check_uniqueness(combination,uniqueness)
|
188
|
+
if unique_chars == combination.length-1
|
189
|
+
puts combination if info[:piped]
|
190
|
+
unless unique_file.nil?
|
191
|
+
unless data[:extra_chars].nil?
|
192
|
+
if data[:iteration] != 0
|
193
|
+
unique_file.puts(combination)
|
194
|
+
end
|
195
|
+
else
|
196
|
+
unique_file.puts(combination)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
unique_combs= unique_combs+1
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
data[:iteration] +=1 if !data[:iteration].nil?
|
204
|
+
char_sum +=1
|
176
205
|
rescue => e
|
177
206
|
raise
|
178
207
|
end while char_sum <= total_characters
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phoenix_password
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spiros Avlonitis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,19 +63,13 @@ extra_rdoc_files: []
|
|
63
63
|
files:
|
64
64
|
- ".gitignore"
|
65
65
|
- ".rspec"
|
66
|
-
- ".travis.yml"
|
67
66
|
- CODE_OF_CONDUCT.md
|
68
67
|
- Gemfile
|
69
68
|
- LICENSE.txt
|
70
69
|
- README.md
|
71
70
|
- Rakefile
|
72
|
-
- bin/console
|
73
|
-
- bin/setup
|
74
71
|
- lib/phoenix_password.rb
|
75
72
|
- lib/phoenix_password/version.rb
|
76
|
-
- phoenix_password-0.1.2.gem
|
77
|
-
- phoenix_password-0.1.3.gem
|
78
|
-
- phoenix_password.gemspec
|
79
73
|
homepage: https://github.com/spirosavlonitis/phoenix_password
|
80
74
|
licenses:
|
81
75
|
- MIT
|
data/.travis.yml
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "phoenix_password"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/phoenix_password-0.1.2.gem
DELETED
Binary file
|
data/phoenix_password-0.1.3.gem
DELETED
Binary file
|
data/phoenix_password.gemspec
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'phoenix_password/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "phoenix_password"
|
8
|
-
spec.version = PhoenixPassword::VERSION
|
9
|
-
spec.authors = ["Spiros Avlonitis"]
|
10
|
-
spec.email = ["spirosa84@hotmail.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{PhoenixPassword is an all purpose password genrator.}
|
13
|
-
spec.description = %q{Phoenix password generator provides you with several options for generating passwords, which characters are to be used,combination length,character uniqueness etc.}
|
14
|
-
spec.homepage = "https://github.com/spirosavlonitis/phoenix_password"
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
-
f.match(%r{^(test|spec|features)/})
|
20
|
-
end
|
21
|
-
spec.bindir = "exe"
|
22
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = ["lib"]
|
24
|
-
|
25
|
-
spec.add_development_dependency "bundler", "~> 1.14"
|
26
|
-
spec.add_development_dependency "rake", "~> 12.0"
|
27
|
-
spec.add_development_dependency "rspec", "~> 3.5"
|
28
|
-
end
|