summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlice Kærast <kaerast@newscloud.com>2010-08-02 12:02:26 +0100
committermarkus <markus@AVA-351181.(none)>2010-08-03 15:19:45 -0700
commit1cba9a7a713261fd62ceec440a3e57667eb103ba (patch)
tree972f9ab775f31f9b22138873c7184b0fd8dd9b0a /lib
parent1dfd2b6ba30f7a4c06688e18d0d6cd73a2e45d91 (diff)
downloadpuppet-1cba9a7a713261fd62ceec440a3e57667eb103ba.tar.gz
puppet-1cba9a7a713261fd62ceec440a3e57667eb103ba.tar.xz
puppet-1cba9a7a713261fd62ceec440a3e57667eb103ba.zip
added md5 support as requested in http://serverfault.com/questions/166199/puppet-md5-sum-of-string
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/functions/md5.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/md5.rb b/lib/puppet/parser/functions/md5.rb
new file mode 100644
index 000000000..f7a4f7222
--- /dev/null
+++ b/lib/puppet/parser/functions/md5.rb
@@ -0,0 +1,5 @@
+Puppet::Parser::Functions::newfunction(:md5, :type => :rvalue, :doc => "Returns a MD5 hash value from a provided string.") do |args|
+ require 'md5'
+
+ Digest::MD5.hexdigest(args[0])
+end