Small nit. I think that it helps readability (and code reviewers) if the function is defined before it is used. 

That is, I would suggest to move `check_md5` to somewhere in the file before this call to the function.