# Are there cryptographic hash functions which do not have any collisions?

I've been studying digital signatures and hash functions recently, and I was wondering: Do hash functions exist which will never produce collisions?

• Not unless its range is larger than or equal to its domain. Collisions are inevitable in all other cases because of the pigeonhole principle. – pg1989 Jan 2 '15 at 2:57
• There exist one-way functions which have no collisions, but obviously their output will be at least the size of the input. – CodesInChaos Jan 2 '15 at 15:48

• @Thomas, a nitpick: pers FIPS 186-4, the input domain of SHA-256 (widely acknowledged to be a cryptographic hash function) is bitstrings of less than $2^{64}$ bits, which is a large but not infinite domain. – fgrieu Jan 5 '15 at 17:54