Puppet Function: bin_to_hex

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

Overview

bin_to_hex(String $input_str)String

Parameters:

  • input_str (String)

Returns:

  • (String)


1
2
3
4
5
6
7
8
9
10
# File 'lib/puppet/functions/bin_to_hex.rb', line 1

Puppet::Functions.create_function(:bin_to_hex) do
  dispatch :bin_to_hex do
    param 'String', :input_str
    return_type 'String'
  end

  def bin_to_hex(input_str)
    input_str.each_byte.map { |b| b.to_s(16) }.join
  end
end