Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/madsjulia/Mads.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Oct 21, 2024
2 parents 3b202f6 + 46f1d32 commit 3453201
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MadsIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ function createhash!(DATA::DATA)
end
end

function checkhash(excel_file::AbstractString, target_hash::AbstractString, throw_error::Bool=false)::Bool
function checkhash(input_file::AbstractString, target_hash::AbstractString, throw_error::Bool=false)::Bool
local hash
open(excel_file) do f
open(input_file) do f
hash = SHA.bytes2hex(SHA.sha2_256(f))
end
check = hash == target_hash
if !check
@info("Current hash: $(hash)")
@info("Expected hash: $(target_hash)")
if throw_error
@error "File hash for $(excel_file) does not match!"
@error "File hash for $(input_file) does not match!"
throw("Error")
end
else
@info "File hash for $(excel_file) matches!"
@info "File hash for $(input_file) matches!"
end
return check
end
Expand Down

0 comments on commit 3453201

Please sign in to comment.