# Modules

> Every module in the package, grouped by what you are doing.

Import each one by its subpath, `knotkit/<name>`.

Filter 32 modules by name, export, or task…

## Collections

Queues, heaps, sets, maps, interval indexes, sorted blocks, caches, and rate limits.

* [bitsetProvides exact membership, cardinality, set algebra, and order statistics over unsigned 32-bit ids, in one flat bitmap or 65,536-id chunks](/modules/bitset/)
* [cacheBounds an in-memory key-value store by entry count or total weight, with least-recently-used, SIEVE, S3-FIFO, or caller-supplied eviction and optional expiry](/modules/cache/)
* [dequeQueues elements at both ends in O(1) amortized time, over array and Float64Array ring buffers, with an optional fixed capacity that turns the queue into a sliding window](/modules/deque/)
* [disjoint-setTracks which elements belong to the same set, with dense-index, object, and struct-of-arrays layouts](/modules/disjoint-set/)
* [frequency-tableMaintains exact counts, prefix sums, range sums, and rank selection over a fixed integer domain](/modules/frequency-table/)
* [heapProvides binary and k-ary min/max heaps plus indexed priority queues, ordered by caller-supplied comparators](/modules/heap/)
* [interval-indexIndexes closed intervals over a caller-supplied order and finds every interval that holds a point or overlaps a range](/modules/interval-index/)
* [ordered-mapStores keys in comparator order with insertion, deletion, rank, selection, ceiling, floor, and range scans in either direction, as a B-tree or an indexed skip list](/modules/ordered-map/)
* [rate-limitLimits each client's request weight by a fixed window, a sliding window, or a token bucket, returning the least whole millisecond a denial must wait](/modules/rate-limit/)
* [snapshot-setKeeps every snapshot readable for the lifetime of the set, at O(1) mutation and snapshot cost](/modules/snapshot-set/)
* [sorted-blockPacks byte-keyed entries, given in ascending key order, into one immutable prefix-compressed block with point reads, seeks, and range scans](/modules/sorted-block/)
* [sorted-mergeLazily merges sorted iterables in comparator order, preserving duplicates and source order on ties](/modules/sorted-merge/)

## Search and text

Prefix lookup, posting lists, and ranked retrieval.

* [inverted-indexIndexes records by exact keys and scans sorted record IDs for one key or the union of several, using packed posting lists](/modules/inverted-index/)
* [prefix-indexEnumerates a bounded number of distinct strings that start with a prefix in UTF-16 order](/modules/prefix-index/)
* [term-indexIndexes tokenized documents with exact term counts and ranks matching document IDs by BM25](/modules/term-index/)
* [trieResolves delimiter-separated token keys by longest prefix in a single walk](/modules/trie/)

## Graphs and optimization

Traversal, shortest paths, rewriting, and search.

* [combinatoricsCounts permutations, combinations, cycles, and set partitions exactly or in log space](/modules/combinatorics/)
* [e-graphPropagates equalities through expressions and extracts a minimum-cost equivalent expression](/modules/e-graph/)
* [evolutionRuns deterministic population evolution with index-based parent selection and immutable permutation operators](/modules/evolution/)
* [graphProvides breadth-first search, Dijkstra, topological order, and connected components over integer-vertex graphs, stored as adjacency lists, compressed sparse rows, or an adjacency matrix](/modules/graph/)

## Randomness and statistics

Seeded sources, sampling, distributions, tests, sketches, and static filters.

* [distanceCompares vectors, probability distributions, and sets and exposes each rule’s mathematical guarantees](/modules/distance/)
* [distributionComputes probabilities, quantiles, moments, and seeded draws for named and caller-defined distributions](/modules/distribution/)
* [hypothesis-testComputes t-test, ANOVA, rank-test, goodness-of-fit, and exact-test p-values for counts, samples, and contingency tables](/modules/hypothesis-test/)
* [prngGenerates seeded pseudorandom numbers and unbiased integers for reproducible simulations and tests](/modules/prng/)
* [samplingDraws unbiased subsets, pairs, shuffles, and weighted samples over injected randomness](/modules/sampling/)
* [scalar-sketchProvides reducible Bloom filter, HyperLogLog, Count-Min Sketch, and MinHash sketches over four scalar domains](/modules/scalar-sketch/)
* [static-filterBuilds immutable Binary Fuse membership filters over a known set of byte keys, with no false negatives and fewer bytes than a Bloom filter at the same false-positive rate](/modules/static-filter/)

## Serialization and utilities

Hashing, order-preserving keys, error classes, and binary envelopes.

* [casAddresses wire-envelope artifacts by content hash and stores them through an injected backend](/modules/cas/)
* [errorsProvides the base error classes every Knotkit package throws from, discriminated by package, category, and cause](/modules/errors/)
* [hashComputes deterministic non-cryptographic XXH64 hashes, identical across browsers, Node.js, and Bun](/modules/hash/)
* [key-encodingEncodes integers, doubles, byte strings, strings, and tuples of them as byte keys whose unsigned byte order matches the values' order](/modules/key-encoding/)
* [wireEncodes bounded binary envelopes and element codecs for Knotkit structures](/modules/wire/)

No module matches. Try describing the task on [Choose a module](/choosing/).
