Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import hashlib, os
unique = dict()
for filename in os.listdir('.'):
if os.path.isfile(filename):
filehash = hashlib.md5(open(filename, 'rb').read()).hexdigest()
if filehash not in unique:
unique[filehash] = filename
else:
print (filename + ' is a duplicate of ' + unique[filehash])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment