Sbbf
Read onlyYes
FinalYes
A split block bloom filter: blocks of eight little-endian u32 words, one bit set per word for each value.
Constants
- BLOCK_BYTES : int = 32
Methods
- bits() : array<int, int>
- The eight bits a hash sets in a bitset of $blocks blocks, numbered from the first byte's lowest bit. $hash is the xxh64 u64 as a signed PHP int, so every shift is masked and the 32-bit multiply is split in 16-bit halves.
- check() : bool
- False only when the value was never inserted.
- fromBytes() : self
- serialized() : string
- As a file holds it, the form BloomFilterReader reads: the thrift header, then the bitset.
Constants
BLOCK_BYTES
public
int
BLOCK_BYTES
= 32
Methods
bits()
The eight bits a hash sets in a bitset of $blocks blocks, numbered from the first byte's lowest bit. $hash is the xxh64 u64 as a signed PHP int, so every shift is masked and the 32-bit multiply is split in 16-bit halves.
public
static bits(int $hash, int $blocks) : array<int, int>
Parameters
- $hash : int
- $blocks : int
Return values
array<int, int>check()
False only when the value was never inserted.
public
check(int $hash) : bool
Parameters
- $hash : int
Return values
boolfromBytes()
public
static fromBytes(string $bitset) : self
Parameters
- $bitset : string
Return values
selfserialized()
As a file holds it, the form BloomFilterReader reads: the thrift header, then the bitset.
public
serialized() : string