Skip to content

Instantly share code, notes, and snippets.

@deepal
Created October 28, 2015 22:50
Show Gist options
  • Save deepal/48e3ce5e9e1f5fccb309 to your computer and use it in GitHub Desktop.
Save deepal/48e3ce5e9e1f5fccb309 to your computer and use it in GitHub Desktop.
def validateIntegrity(orighash, destfilepath):
desthash = hashlib.md5(open(destfilepath, "rb").read()).hexdigest()
if(orighash==desthash):
send_validation_result("1")
return True
else:
os.system("rm "+destfilepath)
send_validation_result("0")
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment