bloomit
Version:
Space efficient bloom filter based on the bloom-filters npm package.
19 lines (16 loc) • 564 B
JavaScript
;
require('chai').should();
const Utils = require('../dist/utils.js');
describe('getDistinctIndices', () => {
it('should take a reasonable number of iterations with pathological inputs', () => {
// construct inputs which make it quite likely that h_2 is coprime with the size, we
// should not get into a loop
const size = 7;
const numIndexes = 7;
const seed = 0;
const maxIterations = 100;
for(let i=0; i<1000; i++) {
Utils.getDistinctIndices(i.toString(), size, numIndexes, seed, maxIterations);
}
});
});