4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/imagemaster3000/verification/hash.rb', line 4
def verify_hash!
logger.debug 'Verifying checksum'
checksum = find_checksum!
computed_checksum = verification[:hash][:function].file(local_filename).hexdigest
if checksum == computed_checksum
verification[:hash][:checksum] = ::Digest::SHA512.file(local_filename).hexdigest
return
end
raise Imagemaster3000::Errors::VerificationError,
"Checksum mismatch for file #{local_filename}: expected: #{checksum}, was: #{computed_checksum}"
end
|