blob: 1197609b1c08729fd0986b24554e3bee6bfc4e56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
class Checksum
attr_reader :hash_type, :hexdigest
alias_method :to_s, :hexdigest
TYPES = [:sha256]
def initialize(hash_type, hexdigest)
@hash_type = hash_type
@hexdigest = hexdigest
end
def empty?
hexdigest.empty?
end
def ==(other)
hash_type == other.hash_type && hexdigest == other.hexdigest
end
end
|