Why not just have a program that iterates through all of the files, hashes them, stores them in a map/dict and then reports if there's a duplicate? Seems easier than renaming everything multiple times.
That's basically fdupe. Also you only have to hash files with the same length, if they aren't the same length you can be quite sure they aren't the same file.
Even such a simple optimization can make a huge difference on a large directory of images or MP3s.
Even such a simple optimization can make a huge difference on a large directory of images or MP3s.