Sha256: 7e16fe7dc1a702f7828468dc8bf028b5241959d37e40d8e1a22cbe6d483fb364

Contents?: true

Size: 364 Bytes

Versions: 32

Compression:

Stored size: 364 Bytes

Contents

# frozen_string_literal: true

class Puppet::SSL::Digest
  attr_reader :digest

  def initialize(algorithm, content)
    algorithm ||= 'SHA256'
    @digest = OpenSSL::Digest.new(algorithm, content)
  end

  def to_s
    "(#{name}) #{to_hex}"
  end

  def to_hex
    @digest.hexdigest.scan(/../).join(':').upcase
  end

  def name
    @digest.name.upcase
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/ssl/digest.rb
puppet-8.10.0-x86-mingw32 lib/puppet/ssl/digest.rb
puppet-8.10.0-x64-mingw32 lib/puppet/ssl/digest.rb
puppet-8.10.0-universal-darwin lib/puppet/ssl/digest.rb
puppet-8.9.0 lib/puppet/ssl/digest.rb
puppet-8.9.0-x86-mingw32 lib/puppet/ssl/digest.rb
puppet-8.9.0-x64-mingw32 lib/puppet/ssl/digest.rb
puppet-8.9.0-universal-darwin lib/puppet/ssl/digest.rb
puppet-8.8.1 lib/puppet/ssl/digest.rb
puppet-8.8.1-x86-mingw32 lib/puppet/ssl/digest.rb
puppet-8.8.1-x64-mingw32 lib/puppet/ssl/digest.rb
puppet-8.8.1-universal-darwin lib/puppet/ssl/digest.rb
puppet-8.7.0 lib/puppet/ssl/digest.rb
puppet-8.7.0-x86-mingw32 lib/puppet/ssl/digest.rb
puppet-8.7.0-x64-mingw32 lib/puppet/ssl/digest.rb
puppet-8.7.0-universal-darwin lib/puppet/ssl/digest.rb
puppet-8.6.0 lib/puppet/ssl/digest.rb
puppet-8.6.0-x86-mingw32 lib/puppet/ssl/digest.rb
puppet-8.6.0-x64-mingw32 lib/puppet/ssl/digest.rb
puppet-8.6.0-universal-darwin lib/puppet/ssl/digest.rb