    def generate(type, str)
      case type
      when :md5
         attribute_value = '{MD5}' + Base64.encode64(Digest::MD5.digest(str)).chomp! 
      when :sha
         attribute_value = '{SHA}' + Base64.encode64(Digest::SHA1.digest(str)).chomp! 
      when :ssha
         srand; salt = (rand * 1000).to_i.to_s 
         attribute_value = '{SSHA}' + Base64.encode64(Digest::SHA1.digest(str + salt) + salt).chomp!
      else
         raise Net::LDAP::HashTypeUnsupportedError, "Unsupported password-hash type (#{type})"
      end
The software generates a hash for a password, but it uses a scheme that does not provide a sufficient level of computational effort that would make password cracking attacks infeasible or expensive.