Class: Mixlib::Authentication::Digester

### Home Classes Methods

### In Files

- lib/mixlib/authentication/digester.rb

### Parent

Object

### Methods

- ::hash_file
- ::hash_string

### Files

- LICENSE
- NOTICE
- README.rdoc

### Class/Module Index

Quicksearch

- Mixlib
- Mixlib::Authentication
- Mixlib::Authentication::AuthenticationError
- Mixlib::Authentication::Digester
- Mixlib::Authentication::HTTPAuthenticationRequest
- Mixlib::Authentication::Log
- Mixlib::Authentication::MissingAuthenticationHeader
- Mixlib::Authentication::SignatureVerification
- Mixlib::Authentication::SignedHeaderAuth
- Mixlib::Authentication::SigningObject

No matching classes.

# Mixlib::Authentication::Digester

### Public Class 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.