News for hackers. Stuff that matters.
Re:Ask HN: md5 + size = file UID? by mooism2 on Monday August 09, 2010 @10:56AM (#1588142)
No, it isn't.

MD5 gives 16 bytes of output, so consider all possible 17 byte files and their MD5 checksums. On average, each checksum will be shared by 256 17 byte files.

If you're worried about MD5 collisions between files, adding the file size isn't going to do much to help. Better to use SHA1 or some other algorithm in addition to MD5. E.g. 16 bytes of MD5 + 20 bytes of SHA1 = 36 bytes total output.

There are no comments on this comment yet.