Skip to content

Commit

Permalink
Update Endings.lst
Browse files Browse the repository at this point in the history
  • Loading branch information
JMARRUJO91 authored May 27, 2024
1 parent 41dd955 commit ab54b90
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Endings.lst
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
# ... (rest of the copyright and license information)


# ----- Hash Validation Setup -----

# Function to validate file hashes
function(validate_hash file algorithm expected_hash)
# ... (implementation same as before)
endfunction()

# Read hashes from hashes.txt
file(STRINGS "hashes.txt" hashes_lines)
foreach(line IN LISTS hashes_lines)
if (line MATCHES "^([A-Za-z0-9]+): ([A-Fa-f0-9]+)$")
set(hash_algorithm ${CMAKE_MATCH_1})
set(hash_value ${CMAKE_MATCH_2})
set(HASHES "${CMAKE_CURRENT_LIST_FILE}"_${hash_algorithm} ${hash_value})
endif()
endforeach()

# ... (rest of your CMake project configuration including the find_package(CppUnit) command)

# Validate hashes of this file
validate_hash("${CMAKE_CURRENT_LIST_FILE}" MD5 "${HASHES_${CMAKE_CURRENT_LIST_FILE}_MD5}")
validate_hash("${CMAKE_CURRENT_LIST_FILE}" SHA1 "${HASHES_${CMAKE_CURRENT_LIST_FILE}_SHA1}")
validate_hash("${CMAKE_CURRENT_LIST_FILE}" SHA256 "${HASHES_${CMAKE_CURRENT_LIST_FILE}_SHA256}")

# ... (rest of your CMake project configuration)




@ed
@ing
@er
Expand Down

0 comments on commit ab54b90

Please sign in to comment.