Puppet Function: wordpress::password_hash

Defined in:
lib/puppet/functions/wordpress/password_hash.rb
Function type:
Ruby 4.x API

Overview

wordpress::password_hash(String $password)String

Hash a string

Parameters:

  • password (String)

    Plain text password.

Returns:

  • (String)

    the password hash from the clear text password.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/puppet/functions/wordpress/password_hash.rb', line 5

Puppet::Functions.create_function(:'wordpress::password_hash') do
  # @param password
  #   Plain text password.
  #
  # @return the password hash from the clear text password.
  #
  dispatch :password do
    required_param 'String', :password
    return_type 'String'
  end

  def password(password)
    return '' if password.empty?
    Digest::SHA1.hexdigest(Digest::SHA512.digest(password))
  end
end