12 ms·
Here is a hash function that does not have hash collisions: fn hash(data): return data
by phinnaeus 5mo ago
Here is a hash function that does not have hash collisions:
fn hash(data):
return data
- Charon77 5mo agoWell it no longer constrains the data in a fixed output length.
- dbdr 5mo agoSure, but if you constrain to fixed output length, you will definitely have collisions (Pigeon Hole Principle). There's no way around that.
- hsbauauvhabzb 5mo agopadding with zeroes to a fixed length and prepending the original length would suffice, but you’d have to have a fixed length of double infinity to account for both the length information and the hash information, and the hash is less efficient than the original information.
- oliver236 5mo agowhat programming language is this?
- tux3 5mo agoThat is a function, but not a hash function!