Questions tagged [universal-hashing]

The main idea behind universal hashing is to select the hash function at random from a carefully designed class of functions at the beginning of execution

Using universal hashing (in a randomized algorithm or data structure) refers to selecting a hash function at random from a family of hash functions with a certain mathematical property (see definition below). This guarantees a low number of collisions in expectation, even if the data is chosen by an adversary. Many universal families are known (for hashing integers, vectors, strings), and their evaluation is often very efficient. Universal hashing has numerous uses in computer science, for example in implementations of hash tables, randomized algorithms, and cryptography.

See more on wikipedia.com

27 questions
0
votes
0 answers

Evaluating probability that a hash function is uniform

I inserted M items into a hash table with N buckets, and found that the largest bucket has K items. How can I compute the p-value corresponding to the null hypothesis that my hash function is uniform? I know that one can derive various…
dshin
  • 2,354
  • 19
  • 29
0
votes
0 answers

How to hide secret strings from application users in desktop installable application?

I have a desktop installable java application which uses some third party jars.These jars need secret key as license.I want third party license info hidden from user of my application. Also we have the limitation that we cannot make network calls to…
0
votes
0 answers

Easily Memorable Hash (what 3 words)

I was hoping to create an easily memorable hash something like 3 random words (what3words), so the idea would be to hash a java object and the result was three random words. Use case: I have objects with many fields and I need to compress the field…
Henry Hargreaves
  • 285
  • 4
  • 18
0
votes
1 answer

Universal Hash Function Implementation for Strings in Java

I have some troubles understanding the implementation of a universal hash function in Java. The hash function (ax + b) mod p should be implemented in base of H_1. Also this implementation should work for strings. I recently worked on this: public…
Jan Lauber
  • 11
  • 3
0
votes
1 answer

Unchange Data, hashing data

I want to save some data in a file like .cvs. One of the condition is, that the data can't change after write in the file. If I want to read the data, it should be save that the data were not change in the past and I want to get an alert, if the…
0
votes
1 answer

Use of universal hashing

I'm trying to understand the usefullness of universal hashing over normal hashing, other than the function is randomly produced everytime, reading Cormen's book. From what i understand in universal hashing we choose the function to…
0
votes
1 answer

Describe an Explicit Universal Hash Function Family

In this problem, I was given the follow mapping U = {0, 1, 2, 3, 4, 5, 6, 7} to {0, 1} From this, there is an explicit universal hashing function that must be derived, with the hint that this can be done with a set of 4 functions. Unfortunately,…
Joe Cur
  • 45
  • 7
0
votes
0 answers

Using C++ class as mere bit container

I'm currently implementing a HashTable in C++ using universal hashing (matrix hashing). The way I implement the matrix is by making an array of pointers (which are merely random bits, they do not "work" as pointers but as a 32x64 bit matrix). In…
0
votes
2 answers

Universal hashing performs worse than modulo hashing, what is wrong?

In case you are not familiar with universal hashing, it's mainly an attempt to guarantee a low number of collisions (as opposed, say with using plain old modulo), using some rather simple math involving randomness. The problem is it doesn't work for…
AdHominem
  • 1,204
  • 3
  • 13
  • 32
-1
votes
2 answers

calculate the probability of having no collision when two elements are hashed h(x)=(x^2+1)mod3

How can I calculate the probability of having no collision after inserting 2 elements. answer is 4/9, but I do not see it how it is 4/9
user2149873
  • 163
  • 1
  • 6
-2
votes
1 answer

universal hash function implementation for bloom filters in C

im simulating set intersection approximation using bloom filters. i have tried a lot of simple hash functions to hash the values to the filter. but its not good at avoiding collisions. so somebody suggested a universal hash function. but im not sure…
-2
votes
1 answer

Is it a secure method to generate token?

I wan't to generate token to verify the email of users, I learn about universal hashing (selecting a hash function at random from a family of hash functions) and I wrote this code in PHP Is it a secure method to generate token ? $string =''; $length…
1
2