class Mixlib::Authentication::Digester

Public Instance Methods

hash_file(f) click to toggle source
# File lib/mixlib/authentication/digester.rb, line 27
def hash_file(f)
  digester = Digest::SHA1.new
  buf = ""
  while f.read(16384, buf)
    digester.update buf
  end
  ::Base64.encode64(digester.digest).chomp
end
hash_string(str) click to toggle source

Digests a string, base64's and chomps the end

Parameters

# File lib/mixlib/authentication/digester.rb, line 40
def hash_string(str)
  ::Base64.encode64(Digest::SHA1.digest(str)).chomp
end