org.xlattice.crypto.filters

## Interface KeySelector.WordSelector

- All Known Implementing Classes:
    KeySelector.GenericWordSelector
  Enclosing class:
    KeySelector

      public static interface KeySelector.WordSelector

  Interface for extracting word offsets from cryptographic keys for Bloom filter operations.

  Word selectors are used to determine which words (multi-bit groups) in a key should be examined or set when performing Bloom filter operations. Each word offset represents a specific word position within the key that corresponds to a hash function's target in the filter's word array.

  Word selection is complementary to bit selection - while bit selectors identify individual bit positions, word selectors identify groups of bits (words) that can be processed more efficiently in some Bloom filter implementations. The word size is determined by the filter's m parameter (filter size as power of 2).

  The word selection algorithm extracts k word positions from key data, where each word position corresponds to a specific hash function's target word in filter's word array. This enables efficient mapping from key data to Bloom filter word positions.

  Implementations must be thread-safe as they may be used concurrently by multiple threads accessing the same Bloom filter.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `getWordSelectors(byte[] b, int offset, int length, int[] wordOffset)` Extracts k word offsets from a key for Bloom filter operations.

- - ### Method Detail

    - #### getWordSelectors

          void getWordSelectors(byte[] b,
                                int offset,
                                int length,
                                int[] wordOffset)

      Extracts k word offsets from a key for Bloom filter operations.

      This method populates the provided wordOffset array with k integer values, each representing a word position within the key that should be used by a hash function. The word positions are calculated based on key data and the specific word selection algorithm.

      The offset and length parameters allow processing of subsets of key data, enabling flexible key handling for different key sizes and Bloom filter configurations. The word size is determined by (m-5) where m is the filter size parameter.

      Parameters:
        `b` - key data as byte array
        `offset` - starting position within the key array
        `length` - number of bytes to process from the key
        `wordOffset` - output array of length k to store calculated word offsets