Signed-off-by: James Turnbull <[EMAIL PROTECTED]>
---
 lib/puppet/parser/ast/function.rb |    2 +-
 lib/puppet/parser/functions.rb    |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/parser/ast/function.rb 
b/lib/puppet/parser/ast/function.rb
index 63d7c7a..eb36fa9 100644
--- a/lib/puppet/parser/ast/function.rb
+++ b/lib/puppet/parser/ast/function.rb
@@ -42,7 +42,7 @@ class Puppet::Parser::AST
                 raise Puppet::DevError, "Invalid function type %s" % 
@ftype.inspect
             end
 
-            # Lastly, check the arity
+            # Lastly, check the parity
         end
     end
 end
diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb
index 8decb82..51903e9 100644
--- a/lib/puppet/parser/functions.rb
+++ b/lib/puppet/parser/functions.rb
@@ -317,6 +317,14 @@ module Functions
             end
             output
     end
+    
+    newfunction(:sha1, :type => :rvalue,
+        :doc => "Returns a SHA1 hash value from a provided string.") do |args|
+            require 'sha1'
+
+            Digest::SHA1.hexdigest(args[0])
+    end
+
 end
 end
 
-- 
1.5.3.3


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to