If used naively, that doesn't work out well for large files, because they have to be read from disc entirely.
If you care about performance, you might just want to hash the first 5% (or the first 1k or whatever) and see if there are any collisions, and if there are you can still look at the entire file.