module ActiveLdap::UserPassword

def ssha(password, salt=nil)

def ssha(password, salt=nil)
  if salt and salt.size < 4
    raise ArgumentError, _("salt size must be >= 4: %s") % salt.inspect
  end
  salt ||= Salt.generate(4)
  sha1_hash_with_salt = "#{Digest::SHA1.digest(password + salt)}#{salt}"
  "{SSHA}#{[sha1_hash_with_salt].pack('m').gsub("\n", '')}"
end