【发布时间】:2018-04-05 16:04:55
【问题描述】:
我正在寻找一种在我的 Java 项目中使用 (universal) family of pairwise independent hash functions 的快速简便的方法。
理想情况下,我应该有一些对象 UniversalFamily(代表家庭),它会使用 hash() 散列整数的方法返回我的对象。
示例用法:
// use this object to generate pairwise independent hash functions
UniversalFamily family = new UniversalFamily();
// these objects represent the pairwise independent hash functions
HashF hashF1 = fam.getHashFunction();
HashF hashF2 = fam.getHashFunction();
// ...
/* here the hash functions are being used to hash the integers 1, 2 and
1337, the return values (not stored) are the results of the
corresponding hash functions. */
hashF1.hash(1);
hashF1.hash(2);
hashF2.hash(1337);
// ...
在我开始修补之前,是否已经有类似的东西可用?
【问题讨论】:
-
hashF2.hash(1337);在这个例子中1337是什么? -
@JigarJoshi 一个整数,我对散列整数感兴趣。
-
我担心这可能过于宽泛和离题,因为你有点要求推荐。无论如何,我在帮助部分找不到足够的行,并且我个人喜欢你的问题的清晰性(以及我看到你正在编辑的工作量),所以我不会标记它。祝你好运。
-
好的,这就是你的函数的输入。 commons.apache.org/proper/commons-lang/apidocs/org/apache/… 最接近
标签: java hash universal-hashing