Puppet Function: sha1digest
- Defined in:
- lib/puppet/parser/functions/sha1digest.rb
- Function type:
- Ruby 3.x API
Overview
Hash a plaintext using SHA-1 Digest
Example:
sha1digest("hello") # => "{SHA}6d3L1UCJtULYvBnp47aqAvjtfM8="
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/puppet/parser/functions/sha1digest.rb', line 2 newfunction(:sha1digest, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Hash a plaintext using SHA-1 Digest Example: sha1digest("hello") # => "{SHA}6d3L1UCJtULYvBnp47aqAvjtfM8=" ENDHEREDOC "{SHA}#{[Digest::SHA1.digest(args[0])].pack('m0').strip}" end |