Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Universal hashing

I do not quite understand how universal hashing works. For example, when I insert an item into my hash table, I have to choose a random function from my universal family of hash functions. Now I want to retrieve said item. How will my hash table know which function it has to use to calculate the hash?

like image 345
ryyst Avatar asked Jul 08 '11 08:07

ryyst


People also ask

What makes a hash function universal?

[h(x) = h(y)] ≤ 1/M. We also say that a set H of hash functions is a universal hash function family if the procedure “choose h ∈ H at random” is universal. (Here we are identifying the set of functions with the uniform distribution over the set.)

What is a 2 universal hash function?

2. Universal hash families. Family of hash functions H is 2-universal if for any x≠y, Pr[h(x)=h(y)] ≤ 1/n for random h∈H.

What are the different types of hashing?

Some common hashing algorithms include MD5, SHA-1, SHA-2, NTLM, and LANMAN. MD5: This is the fifth version of the Message Digest algorithm. MD5 creates 128-bit outputs. MD5 was a very commonly used hashing algorithm.

What are the 3 types of the hash collision algorithms?

Take into account the following hash algorithms – CRC-32, MD5, and SHA-1. These are common hash algorithms with varying levels of collision risk.


2 Answers

Because you'll use the same hash function for all the items in the table.

like image 197
Ignacio Vazquez-Abrams Avatar answered Nov 15 '22 08:11

Ignacio Vazquez-Abrams


Which hash function is used is random only in the sense that they are not predictable by an adversary but the choice is a function of the key. There is a nice write up at http://www.cs.ucsb.edu/~suri/cs130a/Hashing.txt The matrix method is easier to understand than other methods...

like image 43
R V Marti Avatar answered Nov 15 '22 09:11

R V Marti