Hashing a list (vector)

Revision en2, by I_am_Drew, 2020-06-26 18:50:54

I have come up with (invent) a new list hashing algorithm that you can use to hash lists whenever you want. The secret is simple:

Suppose B is a dict (map) ar = list (vector)

Then for a list consisting of two elements, we need to match this number:

B[pow(ar[0], 37, 1000000007) + pow(ar[1], 43, 1000000007)] = [ar[0], ar[1]]

So we have mapped a list of 2 elements to a number!!!

The more items in the list, the further we can add pow(ar[i], P_i, 1000000007), where i is the trace. index in the list (vector), and P_i is the trace. Prime number.

With this hashing of lists (vectors), we can with a probability of 95-99% drive the problem to OK without much bother!!!

I hope the article was useful!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English I_am_Drew 2020-06-26 18:50:54 9 Tiny change: 'e up with a new lis' -> 'e up with (invent) a new lis'
en1 English I_am_Drew 2020-06-26 18:42:44 731 Initial revision (published)