arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2008.08654cs.DS
收藏

使用Mersenne Primes进行散列的能力

The Power of Hashing with Mersenne Primes

Thomas Dybdahl Ahle, Jakob Tejs Bæk Knudsen, Mikkel Thorup

摘要:

计算$k$ -通用散列函数的经典方法是使用素数域$\mathbb Z_p$上的随机次数$(k-1)$多项式。为了快速计算多项式,通常选择素数$p$作为梅森素数$p=2^b-1$。在本文中,我们表明,还有其他很好的优点,使用梅森素数。我们的观点是,散列函数的输出是一个$b$位整数,它均匀分布在$\{0, \dots, 2^b-1\}$中,只是缺少$p$(二进制中的所有\texttt 1的值)。统一位串有许多很好的属性,比如分裂成子串,这给了我们两个或多个散列函数,同时保持了强大的理论性质。我们称之为“二选一”散列,我们在经典的Count Sketch算法中的4-通用散列上演示了它,用于二阶矩估计。我们还提供了一个新的快速无分支码的除法和模梅森素数。对比我们的分析工作,这个代码推广到任何伪梅森素数$p=2^b-c$小$c$。

英文摘要:

The classic way of computing a $k$-universal hash function is to use a random degree-$(k-1)$ polynomial over a prime field $\mathbb Z_p$. For a fast computation of the polynomial, the prime $p$ is often chosen as a Mersenne prime $p=2^b-1$. In this paper, we show that there are other nice advantages to using Mersenne primes. Our view is that the hash function's output is a $b$-bit integer that is uniformly distributed in $\{0, \dots, 2^b-1\}$, except that $p$ (the all \texttt1s value in binary) is missing. Uniform bit strings have many nice properties, such as splitting into substrings which gives us two or more hash functions for the cost of one, while preserving strong theoretical qualities. We call this trick "Two for one" hashing, and we demonstrate it on 4-universal hashing in the classic Count Sketch algorithm for second-moment estimation. We also provide a new fast branch-free code for division and modulus with Mersenne primes. Contrasting our analytic work, this code generalizes to any Pseudo-Mersenne primes $p=2^b-c$ for small $c$.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑