distillate 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +38 -12
  2. package/dist/blocked/index.cjs +1 -1
  3. package/dist/blocked/index.js +1 -1
  4. package/dist/bloom/index.cjs +3 -4
  5. package/dist/bloom/index.d.cts +12 -2
  6. package/dist/bloom/index.d.ts +12 -2
  7. package/dist/bloom/index.js +2 -3
  8. package/dist/bytes-Be7tq1F7.js +9 -0
  9. package/dist/bytes-D2duG1jq.cjs +14 -0
  10. package/dist/countmin/index.cjs +13 -4
  11. package/dist/countmin/index.d.cts +15 -2
  12. package/dist/countmin/index.d.ts +15 -2
  13. package/dist/countmin/index.js +12 -3
  14. package/dist/cuckoo/index.cjs +1 -1
  15. package/dist/cuckoo/index.js +1 -1
  16. package/dist/fuse/index.cjs +1 -1
  17. package/dist/fuse/index.js +1 -1
  18. package/dist/{hasher-3Cyn7Yg-.js → hasher-DOdmZ-LI.js} +1 -8
  19. package/dist/{hasher-MhY7aQ8F.cjs → hasher-DPXmP7SH.cjs} +2 -9
  20. package/dist/hll/index.cjs +10 -4
  21. package/dist/hll/index.d.cts +13 -2
  22. package/dist/hll/index.d.ts +13 -2
  23. package/dist/hll/index.js +9 -3
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/scalable/index.cjs +5 -6
  27. package/dist/scalable/index.js +2 -3
  28. package/dist/{bitset-QYGqxnEf.cjs → sizing-Ch0SDdza.cjs} +15 -0
  29. package/dist/{bitset-Cf2jwRJX.js → sizing-zxCBlyhO.js} +10 -1
  30. package/dist/topk/index.cjs +423 -0
  31. package/dist/topk/index.d.cts +207 -0
  32. package/dist/topk/index.d.ts +207 -0
  33. package/dist/topk/index.js +411 -0
  34. package/package.json +9 -1
  35. package/dist/sizing-BmKfHf_V.d.cts +0 -34
  36. package/dist/sizing-BmKfHf_V.d.ts +0 -34
  37. package/dist/sizing-D3-_7pdP.js +0 -25
  38. package/dist/sizing-R1pwbzjC.cjs +0 -42
@@ -1,34 +0,0 @@
1
- //#region src/core/sizing.d.ts
2
- /** Bloom filter geometry: the `BloomParams` fields a sizing solve determines. */
3
- interface BloomSizing {
4
- /** Number of bits in the filter. */
5
- m: number;
6
- /** Number of hash probes per key. */
7
- k: number;
8
- }
9
- /** Optimal Bloom-filter sizing: `m` bits and `k` hashes for `n` items at target FPR `epsilon`. */
10
- declare function bloomSizing(n: number, epsilon: number): BloomSizing;
11
- /** HyperLogLog geometry: the `HllParams` fields a sizing solve determines. */
12
- interface HllSizing {
13
- /** Precision: the sketch holds `2 ** p` registers. */
14
- p: number;
15
- }
16
- /**
17
- * Smallest precision whose standard error `1.04 / sqrt(2 ** p)` meets
18
- * `relativeError`. Throws {@link ParamError} when even `HLL_MAX_P` cannot.
19
- */
20
- declare function hllSizing(relativeError: number): HllSizing;
21
- /** Count-Min geometry: the `CountMinParams` fields a sizing solve determines. */
22
- interface CountMinSizing {
23
- /** Counters per row. */
24
- width: number;
25
- /** Number of rows, one probe each. */
26
- depth: number;
27
- }
28
- /**
29
- * Count-Min sizing: `width` columns and `depth` rows for an estimate at most
30
- * `epsilon * total` above the true count, with probability `1 - delta`.
31
- */
32
- declare function countMinSizing(epsilon: number, delta: number): CountMinSizing;
33
- //#endregion
34
- export { countMinSizing as a, bloomSizing as i, CountMinSizing as n, hllSizing as o, HllSizing as r, BloomSizing as t };
@@ -1,25 +0,0 @@
1
- import { i as assertProbability, t as ParamError } from "./params-CeajSrwv.js";
2
- //#region src/core/sizing.ts
3
- function bloomSizing(n, epsilon) {
4
- const m = Math.ceil(-n * Math.log(epsilon) / (Math.LN2 * Math.LN2));
5
- return {
6
- m,
7
- k: Math.max(1, Math.round(m / n * Math.LN2))
8
- };
9
- }
10
- function hllSizing(relativeError) {
11
- assertProbability(relativeError, "relativeError");
12
- const p = Math.max(4, Math.ceil(2 * Math.log2(1.04 / relativeError)));
13
- if (p > 18) throw new ParamError(`relativeError ${String(relativeError)} needs precision ${String(p)}, above the maximum ${String(18)}`);
14
- return { p };
15
- }
16
- function countMinSizing(epsilon, delta) {
17
- assertProbability(epsilon, "epsilon");
18
- assertProbability(delta, "delta");
19
- return {
20
- width: Math.ceil(Math.E / epsilon),
21
- depth: Math.ceil(Math.log(1 / delta))
22
- };
23
- }
24
- //#endregion
25
- export { countMinSizing as n, hllSizing as r, bloomSizing as t };
@@ -1,42 +0,0 @@
1
- const require_params = require("./params-UTZbJ22c.cjs");
2
- //#region src/core/sizing.ts
3
- function bloomSizing(n, epsilon) {
4
- const m = Math.ceil(-n * Math.log(epsilon) / (Math.LN2 * Math.LN2));
5
- return {
6
- m,
7
- k: Math.max(1, Math.round(m / n * Math.LN2))
8
- };
9
- }
10
- function hllSizing(relativeError) {
11
- require_params.assertProbability(relativeError, "relativeError");
12
- const p = Math.max(4, Math.ceil(2 * Math.log2(1.04 / relativeError)));
13
- if (p > 18) throw new require_params.ParamError(`relativeError ${String(relativeError)} needs precision ${String(p)}, above the maximum ${String(18)}`);
14
- return { p };
15
- }
16
- function countMinSizing(epsilon, delta) {
17
- require_params.assertProbability(epsilon, "epsilon");
18
- require_params.assertProbability(delta, "delta");
19
- return {
20
- width: Math.ceil(Math.E / epsilon),
21
- depth: Math.ceil(Math.log(1 / delta))
22
- };
23
- }
24
- //#endregion
25
- Object.defineProperty(exports, "bloomSizing", {
26
- enumerable: true,
27
- get: function() {
28
- return bloomSizing;
29
- }
30
- });
31
- Object.defineProperty(exports, "countMinSizing", {
32
- enumerable: true,
33
- get: function() {
34
- return countMinSizing;
35
- }
36
- });
37
- Object.defineProperty(exports, "hllSizing", {
38
- enumerable: true,
39
- get: function() {
40
- return hllSizing;
41
- }
42
- });