Skip to content

Instantly share code, notes, and snippets.

@st0le
Created March 2, 2017 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save st0le/dbfc5242383dd21b81b518a5c28776b0 to your computer and use it in GitHub Desktop.
Save st0le/dbfc5242383dd21b81b518a5c28776b0 to your computer and use it in GitHub Desktop.
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