我正在寻找一种快速简便的方法来在我的 Java 项目中使用(通用)成对独立哈希函数系列。
理想情况下,我会有一些对象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);
// ...
在我开始修补之前,是否已经有类似的东西可用?