summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/htpasswd_sha1.rb
blob: 937621d9858a90099736dbf2354e025d9a1c97aa (plain)
1
2
3
4
5
6
7
8
require 'digest/sha1' 
require 'base64'

module Puppet::Parser::Functions
  newfunction(:htpasswd_sha1, :type => :rvalue) do |args|
    "{SHA}" + Base64.encode64(Digest::SHA1.digest(args[0]))
  end
end