mkpasswd 0.1.0 → 0.1.1

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
- SHA1:
3
- metadata.gz: 1b4e8d9246b2e83e002b00af0f5f90c24aef14b0
4
- data.tar.gz: bd7a9e124b5c8f0879ce544231abc8c5cd596bf6
2
+ SHA256:
3
+ metadata.gz: f0adf4e38727d5d57c224148748c4c690dbc09d76691c735c660613f66ea4b6f
4
+ data.tar.gz: c46146cca3b74716107bbf0c55e1adcbbb1aa9867a62c11543c68401aceb5639
5
5
  SHA512:
6
- metadata.gz: 2449fddc42ef5c1249bfa44f9517b542edb3e3a8f7aca2bcdda8b9b0d2d97a182ca48b36405538735e6349bd4269211aad3f1a7f6175c1349a5dfa8afc7fb512
7
- data.tar.gz: c5fc630fa562a2a129f92935719e99e5c5e985269a0765ab21b90850536ff26afd521b7423a93a221e50ceb2df7dd82f422722f011cca9b64e937e5eec9f09d7
6
+ metadata.gz: d2bd9c69ac88535a81567d81b41a657d7cbddb4c1a4f14fafeaa86841e0bcdaaf837f276e68190002d664aca8b4442ccc7f0db1642b8eb962f0459ad62695ec8
7
+ data.tar.gz: d9a558ba7694086c6b044049cbaf71849d3910a88e6388f6f130d65d82d6cd61e62087864d245d76b5b77554db9163ad52d59e284109ce657a787d451c3bde8d
@@ -1,3 +1,3 @@
1
1
  class Mkpasswd
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
data/lib/mkpasswd.rb CHANGED
@@ -20,7 +20,7 @@ class Mkpasswd
20
20
 
21
21
  def initialize(args)
22
22
  self.options = OpenStruct.new
23
- options.hashmethod = 'des'
23
+ options.hashmethod = 'sha-512'
24
24
  options.hasher = HASHERS[options.hashmethod]
25
25
 
26
26
  OptionParser.new do |opts|
@@ -35,7 +35,7 @@ class Mkpasswd
35
35
  puts HASHERS.keys
36
36
  exit
37
37
  end
38
- options.hashmethod = hasher.to_s
38
+ options.hashmethod = hasher.to_s.downcase
39
39
  options.hasher = HASHERS[options.hashmethod]
40
40
  raise 'Invalid hash algorithm for -m/--method' if options.hasher.nil?
41
41
  end
@@ -45,6 +45,10 @@ class Mkpasswd
45
45
  options.salt = salt
46
46
  end
47
47
 
48
+ opts.on('-s', 'Read input from stdin') do
49
+ options.read_from_stdin = true
50
+ end
51
+
48
52
  opts.on('-R', '--rounds [ROUNDS]', Integer, 'Set number of hashing rounds (SHA256/SHA512 only)') do |rounds|
49
53
  raise 'Invalid hashing rounds for -R/--rounds' if rounds.nil? || rounds.to_i <= 0
50
54
  options.rounds = rounds
@@ -64,6 +68,8 @@ class Mkpasswd
64
68
  options.password = ARGV.shift
65
69
  if options.password
66
70
  $0 = $0 # this invocation will get rid of the command line arguments from the process list
71
+ elsif options.read_from_stdin
72
+ options.password = $stdin.read.chomp
67
73
  else
68
74
  options.password = ask_password
69
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkpasswd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-21 00:00:00.000000000 Z
11
+ date: 2022-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unix-crypt
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description:
83
+ description:
84
84
  email:
85
85
  - envek@envek.name
86
86
  executables:
@@ -106,7 +106,7 @@ homepage: https://github.com/Envek/mkpasswd
106
106
  licenses:
107
107
  - MIT
108
108
  metadata: {}
109
- post_install_message:
109
+ post_install_message:
110
110
  rdoc_options: []
111
111
  require_paths:
112
112
  - lib
@@ -121,9 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.4.6
126
- signing_key:
124
+ rubygems_version: 3.3.3
125
+ signing_key:
127
126
  specification_version: 4
128
127
  summary: Command to generate password hashes, compatible by options with command from
129
128
  GNU/Linux whois package.