3 ms·
It's the arbitrary length that causes you to have more pigeons than pigeonholes.
by smallnamespace 10y ago
It's the arbitrary length that causes you to have more pigeons than pigeonholes.
- koolba 10y ago> It's the arbitrary length that causes you to have more pigeons than pigeonholes. No you can have a fixed length and arbitrary text. Say the input could be 32 hex characters representing a UUID. The key distinction is whether there is a finite / known list of the possible inputs. If so, then it's possible to create a hash function the perfectly hashes them.
- smallnamespace 10y agoUm, a fixed set of inputs cannot be of arbitrary length, since you by definition know the size of the longest possible input string. The point is that a function cannot bijectively compress arbitrary input into fixed output. Of course if you make the function itself depend on the input itself, then you can pull all sorts of tricks, but normally we do not call a simple lookup table a 'hash function', because they are very different things.