Read the list of known good ones into a dictionary (keys: file paths, values, hashes). Then once you have recomputed the hash of a file, retrieve the expected hash from the dictionary using the file path, and compare the two.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Your one-stop place for all your GIMP needs: gimp-forum.net