class
Crowbar::Selectors::Entropy
- Crowbar::Selectors::Entropy
- Crowbar::Selector
- Reference
- Object
Overview
Selects regions based on Shannon information entropy:
- :high entropy (>= threshold, default 6.5 bits/byte): identifies compressed, encrypted, or random payload chunks.
- :low entropy (<= threshold, default 2.5 bits/byte): identifies repetitive padding, null blocks, or tabular space runs.
Defined in:
crowbar/selectors/entropy.crConstructors
Class Method Summary
-
.calculate_entropy(bytes : Bytes) : Float64
Calculates Shannon entropy in bits per byte [0.0 ..
Instance Method Summary
- #mode : Mode
-
#select(buffer : Buffer) : Array(Tuple(Int32, Int32))
Returns an array of target ranges {start_index, end_index_exclusive}
- #threshold : Float64
- #window_size : Int32
Instance methods inherited from class Crowbar::Selector
&(other : Selector) : Selector
&,
|(other : Selector) : Selector
|,
~ : Selector
~,
select(buffer : Buffer) : Array(Tuple(Int32, Int32))
select,
weight : Float64
weight,
weight=(weight : Float64)
weight=
Constructor methods inherited from class Crowbar::Selector
new(weight : Float64 = 1.0)
new
Constructor Detail
def self.new(mode : Mode | Symbol = :high, threshold : Float64 | Nil = nil, window_size : Int32 = 32, weight : Float64 = 1.0)
#
Class Method Detail
def self.calculate_entropy(bytes : Bytes) : Float64
#
Calculates Shannon entropy in bits per byte [0.0 .. 8.0]
Instance Method Detail
Description copied from class Crowbar::Selector
Returns an array of target ranges {start_index, end_index_exclusive}