3 ms·
But then you have to cache the input strings, I don't see how the hash could work any other way independently of the input lengths. And thats rather called an i
by posterboy 10y ago
But then you have to cache the input strings, I don't see how the hash could work any other way independently of the input lengths. And thats rather called an index list compared to the common use of the word, which the GPs might have thought of differently, too..
- koolba 10y ago> But then you have to cache the input strings, I don't see how the hash could work any other way independently of the input lengths. And thats rather called an index list compared to the common use of the word, which the GPs might have thought of differently, too.. It's definitely possible. Here's a simplistic example. Say I have two strings: A really long string that goes on for [truncated] ... and Some other really long string goes on for [truncated] ... I can create a hash function that looks at the first character at gives either a 0 or 1 depending on whether it's an "A". For that known data set it'll perfectly hash the two strings into two buckets. It's a very simplistic example but the same concept can be used to identify the minimum components of the inputs that would need to be looked at to create a unique hash function. It won't be a general hash function though; it's specific to that data set. Note that this isn't useless either. It's common to have a fixed/known lists of strings that you want to do lookups upon.