LibBitSet is a library for working with bitsets. It provides a memory-optimized alternative to using tables like id => true, making it a great option for handling large datasets or tracking boolean states. By utilizing bitwise operations, LibBitSet allows developers to store and manipulate flags efficiently.Key FunctionsCreating a BitSet:local bitSet = LibBitSet:New()Setting a Bit:bitSet:SetBit(index)Sets the bit at the specified index to 1.Clearing a Bit:bitSet:ClearBit(index)Clears the bit at the specified index (sets it to 0).Toggling a Bit:bitSet:ToggleBit(index)Toggles the bit at the specified index (switches between 1 and 0).Getting a Bit Value:local bitValue = bitSet:GetBit(index)Returns the value of the bit (0 or 1) at the specified index.Bitwise OperationsBitwise OR:local result = bitSet:BitwiseOr(otherBitSet)Performs a bitwise OR operation with another bit set.Bitwise AND:local result = bitSet:BitwiseAnd(otherBitSet)Performs a bitwise AND operation with another bit set.Bitwise NOT:local result = bitSet:BitwiseNot(maxIndex)Returns the bitwise negation of the current bit set.Converting to a string:local bitString = bitSet:ToString(maxIndex)Returns a string representation of the bit set.Counting Set Bits:local count = bitSet:CountSetBits()Counts the number of bits set to 1 in the bitset.Iterating Over BitsLibBitSet provides an iterator to loop over the set bits:for index, value in LibBitSetIterator(bitSet) do — Your code hereendThis function will iterate through all set bits.Integration with SavedVarsTo store bit sets in SavedVars, LibBitSet can be easily integrated as shown below:self.data = LibSimpleSavedVars:NewInstallationWide(“MyAddonData”, 1, { items = LibBitSet.New(),})– Load BitSet from SavedVarsself.data.items = LibBitSetLoad(LibBitSet.New(), self.data.items)