c******s 发帖数: 2 | 1 an interview question from a famed security related company.
a list contains 3 million strings (lengths of strings may vary, 1 to 100)
is there any good hash function to generate keys map to them? collsion
free and the shorter the keys are, the better solution.
note there are existing hashing function like sha1 etc, 1) they
don't gurantee collision free 2) the key they generated are
kind of too long, usually 16 digits
you may say how about incremental integer mapping like
1 maps to first string, |
|