Published
Edited
Apr 28, 2022
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function makeBloomFilter(elements, bitCount, hashes) {
const bits = new Array(bitCount).fill(false);
for (const el of elements) {
for (const hash of hashes) {
const bit = hash(el);
bits[bit] = 1;
}
}
const table = arrow.Table.new(arrow.BoolVector.from(bits), ['filter']);
return table;
}
Insert cell
getHashes = (hashCount, bitCount) => [...(new Array(hashCount))]
.map((_, i) => (input => murmur(input, i) % bitCount))
Insert cell
getBitCount = (elementCount, errorProbability) =>
Math.floor(-(elementCount * Math.log(errorProbability))/(Math.LN2 ** 2))
Insert cell
getHashCount = (elementCount, bitCount) =>
Math.round((bitCount / elementCount) * Math.LN2);
Insert cell
Insert cell
async function* getAddress (count, delay = 500) {
for (let i = 0; i < count; i++) {
await Promises.delay(delay, ++i);
yield randomAddress();
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more