MCPcopy Create free account
hub / github.com/ElementsProject/elements / ComputeCapacity

Method ComputeCapacity

src/minisketch/include/minisketch.h:226–226  ·  view source on GitHub ↗

Given field size and a maximum number of decodable elements n, compute what capacity c to * use so that sketches with more elements than n have a chance no higher than 2^-fpbits of * being decoded incorrectly (and will instead fail when decoding for up to n elements). * * See minisketch_compute_capacity for more details. */

Source from the content-addressed store, hash-verified

224 *
225 * See minisketch_compute_capacity for more details. */
226 static size_t ComputeCapacity(uint32_t bits, size_t max_elements, uint32_t fpbits) noexcept { return minisketch_compute_capacity(bits, max_elements, fpbits); }
227
228 /** Reverse operation of ComputeCapacity. See minisketch_compute_max_elements. */
229 static size_t ComputeMaxElements(uint32_t bits, size_t capacity, uint32_t fpbits) noexcept { return minisketch_compute_max_elements(bits, capacity, fpbits); }

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected