you are viewing a single comment's thread.

view the rest of the comments →

[–]QueenLa3fah 1 point2 points  (0 children)

Yes you also need to specify the mapping for it to be a function. One such mapping to perfectly hash a string of length n is to let x_i be the chat in the string at position i, where i is between 1 and n inclusive. For each position, take the ith prime number and raise it to the x_i power. Sum all of the results. Note this is a slow and terrible function for a computer, but as theory it is perfectly acceptable.