Class HTAuth::Sha1
In: lib/htauth/sha1.rb
Parent: Algorithm

an implementation of the SHA based encoding algorithm as used in the apache htpasswd -s option

Methods

encode   new   prefix  

Public Class methods

ignore the params

[Source]

    # File lib/htauth/sha1.rb, line 12
12:         def initialize(params = {}) 
13:         end

Public Instance methods

[Source]

    # File lib/htauth/sha1.rb, line 19
19:         def encode(password)
20:             "#{prefix}#{Base64.encode64(::Digest::SHA1.digest(password)).strip}"
21:         end

[Source]

    # File lib/htauth/sha1.rb, line 15
15:         def prefix
16:             "{SHA}"
17:         end

[Validate]