ferrix/django-cumulus — comment on commit 3682344a8a950f39a40340ce47ad376405860735
File:  line 0
By ferrix:

Okay, I going to use the metadata. Like so:

if obj_info['hash'] == cloudfiles.Object.compute_md5sum(file):
continue

I also noticed a thinko which is that we needed cloud_obj to be defined at that line. I am wondering why I did not meet that before. I am not going to duplicate the code for the md5 as it is used by the library internally and I'd rather have the same bugs (or implementation) in both places.

u'hash': u'56d3661264cce360ac3df5fca33c9d3a'

That's the same as the etag, thus an MD5. The cloudfiles.object.Object.etag returned from 'hash'. A SHA1 would be 40 characters. It is also moderately harder to compute and colliding files are so unlikely that MD5 is actually a sound choice.