BinaryFuse16
Defined in: packages/distillate/src/fuse/fuse.ts:462
A static 16-bit binary fuse filter: like BinaryFuse8 but twice the space (~18 bits/key) for a far lower false-positive rate (~1/65536).
Example
Section titled “Example”const filter = BinaryFuse16.from(["alice", "bob", "carol"]);filter.has("alice"); // trueExtends
Section titled “Extends”BinaryFuse
Accessors
Section titled “Accessors”bitsPerKey
Section titled “bitsPerKey”Get Signature
Section titled “Get Signature”get bitsPerKey():
number
Defined in: packages/distillate/src/fuse/fuse.ts:326
Actual bits stored per key (0 for an empty filter).
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”BinaryFuse.bitsPerKey
Get Signature
Section titled “Get Signature”get seed():
number
Defined in: packages/distillate/src/fuse/fuse.ts:321
Hash seed selected during construction (may differ from 0 after a peel retry).
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”BinaryFuse.seed
Get Signature
Section titled “Get Signature”get size():
number
Defined in: packages/distillate/src/fuse/fuse.ts:316
Number of distinct keys the filter was built from.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”BinaryFuse.size
Methods
Section titled “Methods”equals()
Section titled “equals()”equals(
other):boolean
Defined in: packages/distillate/src/fuse/fuse.ts:393
Tests structural equality: true when other serializes to identical
bytes. A BinaryFuse8 and a BinaryFuse16 are never equal,
since their frames carry different type bytes.
Parameters
Section titled “Parameters”BinaryFuse8 | BinaryFuse16
The filter to compare against.
Returns
Section titled “Returns”boolean
true if the two filters are byte-for-byte identical.
Inherited from
Section titled “Inherited from”BinaryFuse.equals
has(
key):boolean
Defined in: packages/distillate/src/fuse/fuse.ts:361
Tests whether a key is in the set.
Parameters
Section titled “Parameters”BytesLike
The key to test.
Returns
Section titled “Returns”boolean
true if present (possibly a false positive); false guarantees absence.
Inherited from
Section titled “Inherited from”BinaryFuse.has
toBytes()
Section titled “toBytes()”toBytes():
Uint8Array
Defined in: packages/distillate/src/fuse/fuse.ts:335
Serializes the filter to a portable little-endian byte layout.
Returns
Section titled “Returns”Uint8Array
The serialized filter, readable by the matching fromBytes.
Inherited from
Section titled “Inherited from”BinaryFuse.toBytes
toJSON()
Section titled “toJSON()”toJSON():
FilterJSON
Defined in: packages/distillate/src/fuse/fuse.ts:403
Serializes the filter to a JSON-friendly envelope wrapping the base64 of
the toBytes frame.
Returns
Section titled “Returns”The envelope, readable by the matching fromJSON.
Inherited from
Section titled “Inherited from”BinaryFuse.toJSON
from()
Section titled “from()”
staticfrom(keys):BinaryFuse16
Defined in: packages/distillate/src/fuse/fuse.ts:470
Builds a filter from the given keys; duplicates are ignored.
Parameters
Section titled “Parameters”Iterable<BytesLike>
The complete set of keys to store.
Returns
Section titled “Returns”BinaryFuse16
A new immutable filter.
Throws
Section titled “Throws”BinaryFuseBuildError if construction fails to converge.
fromBytes()
Section titled “fromBytes()”
staticfromBytes(bytes):BinaryFuse16
Defined in: packages/distillate/src/fuse/fuse.ts:480
Restores a filter from its BinaryFuse16.toBytes serialization.
Parameters
Section titled “Parameters”Uint8Array
The serialized filter.
Returns
Section titled “Returns”BinaryFuse16
The reconstructed filter.
fromJSON()
Section titled “fromJSON()”
staticfromJSON(value):BinaryFuse16
Defined in: packages/distillate/src/fuse/fuse.ts:490
Restores a filter from its BinaryFuse16.toJSON envelope.
Parameters
Section titled “Parameters”unknown
The JSON envelope.
Returns
Section titled “Returns”BinaryFuse16
The reconstructed filter.