Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Assuming is's a cryptographic hash function, that sort of collision just never happens.


Well, it has to happen at some point. Exceedingly unlikely, but never say never.


When the number of hash values (at least 2^128) exceeds the number of atoms in the observable universe (10^80), it's never going to happen.

... unless the hash function is broken, in which case it's not cryptographic anymore. Note that the birthday paradox doesn't apply when one of the inputs is trivial.


Just because there are a lot of possible values doesn't matter. There are also a lot of possible pieces of data that could be fed into the hash function. In fact, an infinite number. Which is larger than 2^128. Unimaginably larger. Collisions will happen. Sure, intentional collisions might be next to impossible, but collisions will happen.

Consider a piece of data that is 128 bits long. There are 2^128 possible values. A 128 bit hash function will either yield a unique value for each possible data value (which will exhaust the entire range of unique hash values), or you'll have a collision. Now, lets add in pieces of data that are 129 bits (or any other length) as well - you'll have a collision immediately.


2^128 is a big number, and we live in a universe with physical constraints. The mathematical probability is nonzero, but it's never going to happen.


h(1) == h(some_real_data) does not have to happen at some point. Collisions are unavoidable, but the point of a cryptographically secure hash algorithm is to ensure that for all h(x) == h(some_real_data), there are no values of x that can be found by brute force, or by cleverness either for that matter.

Of course, it’s always possible that the particular hash function used could be hilariously broken…


Perhaps I'm misunderstanding you, but doesn't the existence of collisions guarantee that h(1)== h(some_real_data) unless the hash function is hilariously broken?

Cryptographically secure hash functions state that it's unlikely to occur, but the fact that you can take data a greater size than the output will guarantee that you'll have collisions. If you have collisions and the hash function is generating output that is uniformly distributed across the possible output space, you will hit h(1)==h(some_real_data) at some point (edit: given that "some point" is a mathematical concept, not an actual point in time. Of course, there's no guarantee that we'll ever get collisions for hash functions with massive output spaces. But I'd argue that's a limit of computing, not of the math behind the functions themselves)


What makes you think that this would use a cryptographic hash instead of a perceptual hash?


Birthday paradox could play a role if there's enough content out there




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: