Puppet Function: htpasswd::ht_sha1

Defined in:
lib/puppet/functions/htpasswd/ht_sha1.rb
Function type:
Ruby 4.x API

Overview

htpasswd::ht_sha1(String $value)Any

Parameters:

  • value (String)

Returns:

  • (Any)


4
5
6
7
8
9
10
11
12
# File 'lib/puppet/functions/htpasswd/ht_sha1.rb', line 4

Puppet::Functions.create_function(:'htpasswd::ht_sha1') do
  dispatch :ht_sha1 do
    param 'String', :value
  end

  def ht_sha1(value)
    "{SHA}"+Base64.encode64(Digest::SHA1.digest(value)).chomp!
  end
end