mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
24 lines
411 B
Ruby
24 lines
411 B
Ruby
# frozen_string_literal: true
|
|
|
|
# A formula's checksum.
|
|
#
|
|
# @api private
|
|
class Checksum
|
|
extend Forwardable
|
|
|
|
attr_reader :hash_type, :hexdigest
|
|
|
|
TYPES = [:sha256].freeze
|
|
|
|
def initialize(hash_type, hexdigest)
|
|
@hash_type = hash_type
|
|
@hexdigest = hexdigest
|
|
end
|
|
|
|
delegate [:empty?, :to_s] => :@hexdigest
|
|
|
|
def ==(other)
|
|
hash_type == other&.hash_type && hexdigest == other.hexdigest
|
|
end
|
|
end
|