Skip to main content

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 slice buf.
  • 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 slice buf.
  • 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 index b is set, and false otherwise. Returns false if the index is out of bounds.

Getting Started Relevance: NO