Questions tagged [hashing]

158 questions
7
votes
2 answers

simple uniform hashing: unclear definition of probability

I am trying to understand the assumption of Simple Uniform Hashing (SUHA) as e.g., in CLRS textbook; or other courses about hashing. The usual description given to SUHA is (cf. CLRS): "we shall assume that any given element [i.e., key] is equally…
Jack
  • 71
  • 1
  • 5
4
votes
1 answer

Lemma 2 in Knuth's "Notes on Open Addressing"

I'm trying to read Knuth's Notes on Open Addressing, and I don't quite follow the proof of Lemma 2. The set-up We're thinking about hashing $k - 1$ keys into a size $N$ array, with collision resolution via linear probing. In particular, we're…
4
votes
2 answers

Merkle tree collision probability

Say I use a perfect 128-bit hash function to construct a merkle tree. By perfect I mean that any of the values in the $0$–$2^{128}$ range has an equal probability to be an outcome of the function, over a large enough domain of hashed entities. Does…
Jake
  • 49
  • 3
4
votes
0 answers

Expected search times with quadratic vs linear probing

Why exactly does quadratic probing lead to a shorter avg. search time than linear probing? I fully get that linear probing leads to a higher concentration of used slots in the hash table (i.e. higher "clustering" of used consecutive indices).…
3
votes
1 answer

Difference between properties of good hash function: uniformity and randomness

I did go through Korth's book of DBMS and I got these definitions: Uniformity: Each bucket is assigned the same number of search-key values from the set of all possible values. Randomness: Each bucket will have the same number of records assigned to…
Maharaj
  • 274
  • 3
  • 18
3
votes
1 answer

Ketama hash explanation

(I originally posted this on stackoverflow but thought it would be a better fit here) I'm trying to understand the Ketama hash code used in consistent hashing. link and snippet below: public static Long md5HashingAlg(String key) { MessageDigest…
Shobit
  • 185
  • 1
  • 6
2
votes
3 answers

Building a perfect hashing table

My understanding is that one way to build a perfect hash, as per CLRS, is to use two levels of hashing, with universal hashing functions at each level. More specifically, CLRS shows that assuming $n$ is the total number of keys, and $n_j$ the…
2
votes
1 answer

Bit representation of the hashing multiplication method

In the picture below from CLRS, I fail to understand why exactly $h(k)$ = the $p$ highest-order bits of the lower w-bit half of the product. For context, this is supposed to compute $h(k) = \lfloor m (k A \; \text{mod} 1) \rfloor $ For further…
Josh
  • 296
  • 1
  • 11
1
vote
2 answers

Why does Locality Sensitive Hashing use multiple sets of hash tables? How does it guarantee similarity?

With locality sensitive hashing (specifically multi-probe hashing http://www.cs.princeton.edu/cass/papers/mplsh_vldb07.pdf) how are the guarantee of similarity returns made? Why are there multiple tables involved in the hash indexing? Wouldn't that…
nobody
  • 13
  • 4
1
vote
1 answer

Unique ID from date and rotating offset

Hopefully this is the right board for my question, We are facing an issue creating a unique ID from the following inputs : datetime (can be present more than once in the same set, cannot not be present in 2 different sets) offset ( an integer…
noob 86466
  • 13
  • 2
1
vote
0 answers

Checking whether a given Hashing Function fulfills Uniform Hashing Condition

I am learning about Hashing and have struggles with the following assignment: $U$ is a universe of keys with $Z(m)=\{0,\ldots, m-1 \}$ the amount of possible hash-values. Given $U= \mathbb{Z}_{55} = \{0, \ldots, 54 \}$ and $m=5$. Does the function…
SimonAda
  • 11
  • 1
1
vote
2 answers

Algorithm to convert a large number (output of a hashing algorithm) into something easily compared visually by humans?

I'm looking for a way to help my users more easily compare the output of a fingerprinting algorithm (which is a very large number/byte array). So instead of showing something like "8c0db1f40b6e4c1e268a5f3e2405278f" as the fingerprint, I'd rather…
0
votes
0 answers

Hashing routine explanation

As the title states, I would like to know what a hashing routine is. I found online about hashing algorithms but I heard it, being used in a different context.
hal
  • 101
0
votes
0 answers

How does exactly consistent hashing is solving the problem of overloaded nodes?

I am taking a course on Eductive on System Design and I read about the ways the data can be partitioned amongst DB servers. See the snippet below: b. Hash-Based Partitioning: In this scheme, we take a hash of the object we are storing. We then…
Ihor M.
  • 101
0
votes
1 answer

How the out-of-sample problem is solved in the article "One Loss for All Deep Hashing with a Single Cosine Similarity based Learning Objective"?

My question is about the article One Loss for All Deep Hashing with a Single Cosine Similarity based Learning Objective. I would like to know how to solve the out-of-sample problem: given a new code how to find its corresponding orthogonal…
R. S.
  • 167
  • 1
  • 8
1
2