Are hash collisions with different file sizes just as likely as same file size?

Posted by rwmnau on Stack Overflow See other posts from Stack Overflow or by rwmnau
Published on 2010-03-14T15:31:01Z Indexed on 2010/03/14 15:45 UTC
Read the original article Hit count: 362

I'm hashing a large number of files, and to avoid hash collisions, I'm also storing a file's original size - that way, even if there's a hash collision, it's extremely unlikely that the file sizes will also be identical. Is this sound (a hash collision is equally likely to be of any size), or do I need another piece of information (if a collision is more likely to also be the same length as the original).

Or, more generally: Is every file just as likely to produce a particular hash, regardless of original file size?

© Stack Overflow or respective owner

Related posts about hash

Related posts about hash-collision