Sha256: 15593fff4256d8f851741711eafa79138aef6c87c53e20ca2343f2103cb8bab0
Contents?: true
Size: 481 Bytes
Versions: 10
Compression:
Stored size: 481 Bytes
Contents
module Ixtlan class Digest # method from openldap faq which produces the userPassword attribute # for the ldap # @param secret String the password # @param salt String the salt for the password digester # @return the encoded password/salt def self.ssha(secret, salt) require 'sha1' require 'base64' (salt.empty? ? "{SHA}": "{SSHA}") + Base64.encode64(::Digest::SHA1.digest(secret + salt) + salt).gsub(/\n/, '') end end end
Version data entries
10 entries across 10 versions & 1 rubygems