summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/mysql_password.rb
blob: 6443d95c5bc731b780362a4460ac92b3d8b37622 (plain)
1
2
3
4
5
6
7
8
9
# hash a string as mysql's "PASSWORD()" function would do it
require 'digest/sha1'

module Puppet::Parser::Functions
	newfunction(:mysql_password, :type => :rvalue) do |args|
		'*' + Digest::SHA1.hexdigest(Digest::SHA1.digest(args[0])).upcase
	end
end