class Utils

Public Instance Methods

filehash_maker(ident,filename,conid) click to toggle source
# File lib/ruby-fcp/utils.rb, line 6
def filehash_maker(ident,filename,conid)
  content = File.read(filename)
  (Digest::SHA256.new << conid + "-#{ident}-" + content).base64digest
end
id_generate() click to toggle source
# File lib/ruby-fcp/utils.rb, line 15
def id_generate
  SecureRandom.hex
end
packet_mangler(sash,header) click to toggle source
# File lib/ruby-fcp/utils.rb, line 11
def packet_mangler(sash,header)
  header +"\n"+ sash.map{|k,v| "#{k}=#{v}"}.join("\n") + "\nEndMessage\n"
end