Skip to main content

Module bitarray

Module bitarray 

Source
Expand description

Array of boolean values as a large bit vector The malware modeler uses the presence of n-grams as features for the malware detection models it creates. But ultimately each feature is the presence or absense of an n-gram. So instead of wasting memory in integers for just one or zero, use each bit as a true or false, since the presence or absense of a feature n-gram is a binary situation.

The only question is: “what size integer to use?” If many n-grams are expected, then a larger integer size makes sense. But for smaller feature sets a smaller integer size might be better. So this [BitArray] type allows for using any unsigned integer type as a backend, since the user knows their data best. Unsigned is best since we’ll never need a negative representation, especially since we don’t use the integer variable as an integer anyway.

Imagine this bit array as a vector if booleans, but compressed to use the least amount of memory as possible since for our purposes, we’re likely to have a lot of n-gram features (possibly in the millions).

Structs§

BitArray
Array of booleans as a large bit vector
BitArrayIterator
Iterator over the bits in a bit array holding a reference to the array
BitArrayOwnedIterator
Iterator over the bits in a bit array owning the array

Traits§

BitStorage
Trait for integer types which can be used at bit storage