Analysis of multiplication method for hashing

298 Views Asked by At

Given two hashing functions, namely: division method versus multiplication method disadvantages.

Multiplication method: Given that we have hash function $f(k)=⌊N\times(kA−⌊kA⌋)⌋$, where $N,k\in Z$ and $0\lt A \lt 1$.

Division method:$f(k)=k \bmod{N}$ where $N,k∈Z$?

A disadvantage of division method is the fact that possibility is higher to get same hash value if $N = 2^p, p>=0, p \in Z$:

Example:

k:    1111111111010101
m:    0000000010000000 (2^7)
k(m): 0000000001010101

Now do the same for this:

k:    0000000000010101
m:    0000000010000000 (2^7)
k(m): 0000000001010101

Problem: How getting duplicate hashed values is avoided please in Multiplication method compared to division method? In other words, why the possibility to get same image using multiplication method (value of hashing that $k$ is mapped to) is very low compared to division method hash function $f(k)=k \bmod{N}$ please?

Edit: Let $0\lt A \lt 1$.