bloom_utils.go
bloom_utils.go - Overview
This file provides utility functions for manipulating a bit array, used in bloom filter implementations.
Detailed Documentation
Function: setBit
- Purpose: Sets the bit at the given index
b
to 1 in the byte slicebuf
. - Parameters:
buf
([]byte): The byte slice representing the bit array.b
(uint64): The index of the bit to set.
- Returns: None
Function: isBitSet
- Purpose: Checks if the bit at the given index
b
is set to 1 in the byte slicebuf
. - Parameters:
buf
([]byte): The byte slice representing the bit array.b
(uint64): The index of the bit to check.
- Returns: (bool) - Returns
true
if the bit at indexb
is set, andfalse
otherwise. Returnsfalse
if the index is out of bounds.