Created
March 2, 2017 20:17
-
-
Save st0le/dbfc5242383dd21b81b518a5c28776b0 to your computer and use it in GitHub Desktop.
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
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