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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a09e0b1f956a313ce3d4ff00e8f803309949ce63
4
- data.tar.gz: c1adfa0184b895260991bd5f0a1b16f6d3f546f4
3
+ metadata.gz: 1807205fb4c33dec3f0d8f0f0a76a8e51546e6bc
4
+ data.tar.gz: a69879613f2803b82a5d306c850a51217cae4585
5
5
  SHA512:
6
- metadata.gz: 3db615bd4071bb8872fbfd356f1d0f5491916e3bcff46400a581485067be49ce363ff44e7947ae11078b03eb008b131567f587b099c0c1eaacc35820ad8771b0
7
- data.tar.gz: 5fa8b60263805368feee149a8a6e203fcd79470564e01b4bc0a7d67a51f13b5c9844ed4a5de0d8cb635a3b04a9695991ed9a219422af8509716567f5de5cdbac
6
+ metadata.gz: f7fdc581e56666262e5a50d23daf10a94eef66bf7eb343cb7fe4bbef1f523eacc323f02d2973de579477cc5b94efc8a906fcfe3f0f1b2d879b716c245a968098
7
+ data.tar.gz: 90c74efe4204a8f229a5f5ccd6c19b625c1163e57e49c47b03d0e1e00ac02f94f576277df7027f9900bc35b668867792d0f890bfb3e28e80b2b77609a5aaf0d3
data/.gitignore CHANGED
@@ -7,6 +7,11 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /*.gem
11
+
12
+ /.travis.yml
13
+ /bin
14
+ /*.gemspec
10
15
 
11
16
  # rspec failure tracking
12
17
  .rspec_status
@@ -1,3 +1,3 @@
1
1
  class PhoenixPassword
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -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
- yield(combination.join())
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
- yield(combination.join()) if combination.include?(characters.last)
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
- generate_combinations(data) do |combination;i|
91
- if matching_check({:combination=>combination,:match_limit=>info[:match_limit]})
92
- if info[:piped]
93
- puts combination
94
- elsif !matching_file.nil?
95
- if data[:extra_chars].nil?
96
- matching_file.puts(combination)
97
- elsif data[:iteration] >= 1
98
- matching_file.puts(combination)
99
- end
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
- generate_combinations(data) do |combination|
159
- unique_chars=check_uniqueness(combination,uniqueness)
160
- if unique_chars == combination.length-1
161
- puts combination if info[:piped]
162
- unless unique_file.nil?
163
- unless data[:extra_chars].nil?
164
- if data[:iteration] != 0
165
- unique_file.puts(combination)
166
- end
167
- else
168
- unique_file.puts(combination)
169
- end
170
- end
171
- unique_combs= unique_combs+1
172
- end
173
- end
174
- data[:iteration] +=1 if !data[:iteration].nil?
175
- char_sum +=1
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
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-05-31 00:00:00.000000000 Z
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
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.14.6
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
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
Binary file
Binary file
@@ -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