Last active
June 23, 2016 16:40
-
-
Save bsiver/82faf3b0cb39430eae4ed862f9e97daf to your computer and use it in GitHub Desktop.
content checksum computation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute_checksum(content): | |
""" Computes an md5 hash for a partial content object based on the fields in CHECKSUM_COMPARISON_FIELDS """ | |
comparison_dict = {k : content[k] for k in CHECKSUM_COMPARISON_FIELDS} | |
return hashlib.md5(json.dumps(comparison_dict, sort_keys=True)).hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment