Module: Helpema::SSSS

Defined in:
lib/helpema/ssss.rb

Class Method Summary collapse

Class Method Details

.combine(*pwds) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/helpema/ssss.rb', line 14

def self.combine(*pwds)
  pwd = ''
  Open3.popen3("ssss-combine -Q -t #{pwds.length}") do |stdin, stdout, stderr|
    pwds.each{|p| stdin.puts p}
    stdin.close
    pwd = stderr.read.strip.split.last
  end
  return pwd
end

.split(pwd, t, n) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/helpema/ssss.rb', line 4

def self.split(pwd, t, n)
  pwds = nil
  Open3.popen3("ssss-split -Q -t #{t} -n #{n}") do |stdin, stdout, stderr|
    stdin.puts pwd
    stdin.close
    pwds = stdout.read.strip.split
  end
  return pwds
end