From b690f927b3cb8d24c0ef514a989e47ee112eb0b9 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 5 Dec 2008 14:42:12 +0000 Subject: merged with puzzle --- plugins/puppet/parser/functions/htpasswd_sha1.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 plugins/puppet/parser/functions/htpasswd_sha1.rb (limited to 'plugins/puppet') diff --git a/plugins/puppet/parser/functions/htpasswd_sha1.rb b/plugins/puppet/parser/functions/htpasswd_sha1.rb new file mode 100644 index 0000000..937621d --- /dev/null +++ b/plugins/puppet/parser/functions/htpasswd_sha1.rb @@ -0,0 +1,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 -- cgit v1.2.3